RN项目凡是看到 Can’t find variable: XXX

 

均是由于没有 从react-native 中导入 所引起的

比如:

你使用<Image/>

你必须在头部导入Image

import {
  Platform,
  StyleSheet,
  Text,
  View,
  Image,
  ImageRequireSource
} from 'react-native';
 
这样在使用<image /> 组件就不会报错了。

相关文章:

  • 2021-04-28
  • 2022-12-23
  • 2022-02-21
  • 2021-05-26
  • 2021-06-15
  • 2021-06-17
猜你喜欢
  • 2022-12-23
  • 2022-03-06
  • 2021-04-02
  • 2021-05-08
  • 2021-05-01
  • 2022-01-28
  • 2022-12-23
相关资源
相似解决方案