尝试导入错误:'MaskedViewIOS'未从'react-native'导出]]

问题描述 投票:1回答:1

我想学习本地反应。我想构建一个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-native react-navigation react-native-web
1个回答
0
投票

看起来这是react-navigation-stack v1的最新版本react-native-web中的一个问题,但我认为不会得到解决。

© www.soinside.com 2019 - 2024. All rights reserved.