react-native项目中app.js文件错误



我得到一个错误,我在我的react-native项目app.js中声明应用程序组件。它说:"无法为此模块构建类型化接口。"您应该用类型注释该模块的导出。函数return"缺少类型注释;我怎么解决这个问题?

/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import {
Colors,
DebugInstructions,
Header,
LearnMoreLinks,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
import Navigation from './src/navigation';
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
* LTI update could not be added via codemod */
const App = () => {
const isDarkMode = useColorScheme() === 'dark';

return (
<SafeAreaView style={{backgroundColor: '#121211', flex: 1}}>
<StatusBar barStyle={'light-content'} />
<Navigation />
</SafeAreaView>
);
};


export default App;

你需要导入带有-

类型的React
import * as React from 'react';