<ImageBackground source={ require('../../static/images/01.jpg') } style={ this.style.imageBG }>
<Text>登录页</Text>
</ImageBackground>
error: Error: Unable to resolve module ../../static/images/01.jpg from F:\web\react-native\MyStady\src\pages\login\Login.js:
None of these files exist:
* 01.jpg
* src\static\images\01.jpg\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
10 | return (
11 | <View style={{flex: 1}}>
> 12 | <ImageBackground source={ require('../../static/images/01.jpg') } style={ this.style.imageBG }>
| ^
13 | <Text>登录页</Text>
14 | </ImageBackground>
15 | </View>
at ModuleResolver.resolveDependency (F:\web\react-native\MyStady\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:211:15)
at DependencyGraph.resolveDependency (F:\web\react-native\MyStady\node_modules\metro\src\node-haste\DependencyGraph.js:413:43)
at Object.resolve (F:\web\react-native\MyStady\node_modules\metro\src\lib\transformHelpers.js:317:42)
at resolve (F:\web\react-native\MyStady\node_modules\metro\src\DeltaBundler\traverseDependencies.js:629:33)
at F:\web\react-native\MyStady\node_modules\metro\src\DeltaBundler\traverseDependencies.js:645:26
at Array.reduce (<anonymous>)
at resolveDependencies (F:\web\react-native\MyStady\node_modules\metro\src\DeltaBundler\traverseDependencies.js:644:33)
at F:\web\react-native\MyStady\node_modules\metro\src\DeltaBundler\traverseDependencies.js:329:33
at Generator.next (<anonymous>)
at asyncGeneratorStep (F:\web\react-native\MyStady\node_modules\metro\src\DeltaBundler\traverseDependencies.js:137:24)
大佬看看为什么source引入报错,刚接触react-native