React Native 中的屏蔽视图错误为什么它一次又一次发生我需要解决方案编码器
Masked View Error in React Native Why it is happening again and again i need solution coders
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import HomeScreen from './HomeScreen';
const Stack = createNativeStackNavigator();
function App() {
return(
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name = "Home" component={HomeScreen}/>
</Stack.Navigator>
</NavigationContainer>
)
}
export default App;
无法从 D:\React Native\SDR-Project\node_modules@react-navigation\elements\src\MaskedViewNative.tsx 解析模块@react-native-masked-view/masked-view:在项目中找不到@react-native-masked-view/masked-view。
如果您确定该模块存在,请尝试以下步骤:
- 清除守望者手表:watchman watch-del-all
- 删除node_modules和运行纱线安装
- 重置 Metro 的缓存:yarn start --reset-cache
- 删除缓存:rm -rf /tmp/metro-*
6 |
7 |输入 MaskedViewType =
8 | typeof import('@react-native-masked-view/masked-view').default;
| ^
9 |
10 | type Props = React.ComponentProps & {
11 | children: React.ReactElement;
enter image description here
请安装此依赖项。
@react-native-community/masked-view
如果不起作用,则安装 @react-native-masked-view/masked-view
阅读更多关于将 react-navigation 安装到您的项目中的信息,这里列出了一些您必须安装的依赖项,以便 运行 应用程序
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import HomeScreen from './HomeScreen';
const Stack = createNativeStackNavigator();
function App() {
return(
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name = "Home" component={HomeScreen}/>
</Stack.Navigator>
</NavigationContainer>
)
}
export default App;
无法从 D:\React Native\SDR-Project\node_modules@react-navigation\elements\src\MaskedViewNative.tsx 解析模块@react-native-masked-view/masked-view:在项目中找不到@react-native-masked-view/masked-view。
如果您确定该模块存在,请尝试以下步骤:
- 清除守望者手表:watchman watch-del-all
- 删除node_modules和运行纱线安装
- 重置 Metro 的缓存:yarn start --reset-cache
- 删除缓存:rm -rf /tmp/metro-* 6 | 7 |输入 MaskedViewType =
8 | typeof import('@react-native-masked-view/masked-view').default; | ^ 9 | 10 | type Props = React.ComponentProps & { 11 | children: React.ReactElement;
enter image description here
请安装此依赖项。
@react-native-community/masked-view
如果不起作用,则安装 @react-native-masked-view/masked-view
阅读更多关于将 react-navigation 安装到您的项目中的信息,这里列出了一些您必须安装的依赖项,以便 运行 应用程序
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view