我想学习本地反应。我想构建一个Web应用程序和一个Android应用程序。我想在我的应用程序的屏幕之间导航。所以我做到了:
npx create-react-app my-app cd my-app npm install react-native-web
然后我将
index.js
更新为如下形式:
import React from 'react'; import App from './App'; import { AppRegistry } from 'react-native'; AppRegistry.registerComponent('App', () => App); AppRegistry.runApplication('App', { rootTag: document.getElementById('root') });
并且我将
App.js
更新为如下形式:
import React from 'react'; import {createAppContainer} from 'react-navigation'; import {createStackNavigator} from 'react-navigation-stack'; const MainNavigator = createStackNavigator({Home: {screen: function(props){return null}}}); const App = createAppContainer(MainNavigator); export default App;
[当我运行
npm start
命令时,出现错误
./node_modules/react-navigation-stack/lib/module/views/Header/Header.js Attempted import error: 'MaskedViewIOS' is not exported from 'react-native'.
有人知道如何解决此问题吗?
我想学习本地反应。我想构建一个Web应用程序和一个Android应用程序。我想在我的应用程序的屏幕之间导航。所以我这样做:npx create-react-app my-app cd my-app npm install ...
看起来这是react-navigation-stack
v1的最新版本react-native-web
中的一个问题,但我认为不会得到解决。