学习react-native 第三方控件'reat-native-pull' 时,
按照官方,民间各种写法 测了个遍,run 时,一直报错
'you likely forgot to export your component from the file it's defined in ,
or you might have mixed up default and named imports'
大意就是导包错误,我打开node_modules的源码也没察觉到有啥问题,
最终盯着 我写的导包代码:
import PullList from 'react-native-pull';
对比其他导包,终于发现问题所在,以下为正确写法:
import {PullList}from 'react-native-pull';
查了查我理解的:导包时不加括号 意为 导入一个模块并且命名为PullList,
加括号, 意为 导入一个模块的公共方法,类