Comments (2)
Yes, it looks to me like there are extra dependencies specified in package.json
that don't need to be there are are causing problems.
e.g. if I try the link you posted above, it only has the following imports:
import * as React from 'react';
import { View, Text, Button, Image } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
By the way, the first one (the 'react'
import) is no longer needed and can just be deleted.
If you check package.json
it has all of these dependencies specified:
"dependencies": {
"@expo/vector-icons": "^13.0.0",
"@react-native-community/masked-view": "*",
"react-native-gesture-handler": "~2.9.0",
"react-native-pager-view": "6.1.2",
"react-native-paper": "^4.7.2",
"react-native-reanimated": "~2.14.4",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.20.0",
"react-native-tab-view": "^3.0.0",
"@react-navigation/bottom-tabs": "6.3.1",
"@react-navigation/drawer": "6.4.1",
"@react-navigation/elements": "1.3.3",
"@react-navigation/material-bottom-tabs": "6.2.1",
"@react-navigation/material-top-tabs": "6.2.1",
"@react-navigation/native-stack": "6.6.1",
"@react-navigation/native": "6.0.10",
"@react-navigation/stack": "6.2.1"
}
In Snack it does not list things like expo
or react-native
. They are automatically included based on the selected Expo SDK version.
The following should fix this Snack: Remove everything from dependencies
except the stuff you're actually importing:
"dependencies": {
"@react-navigation/native-stack": "6.6.1",
"@react-navigation/native": "6.0.10"
}
Snack will then prompt you to add back a few things and you'll end up with this:
"dependencies": {
"@react-navigation/native": "6.0.10",
"@react-navigation/native-stack": "6.6.1",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.20.0"
}
If I do that it works for me.
from react-navigation.github.io.
@satya164 I think this issue can be closed since you and Cedric fixed the examples
from react-navigation.github.io.
Related Issues (20)
- Stack navigator for each tab code example warning HOT 1
- Inconsistent TypeScript behavior with optional arguments in useNavigation
- Request for a sandbox environment for React Navigation
- Found screens with the same name nested inside one another HOT 2
- React Navigation logo has multiple control points
- In "Help" page witgh presentation set value to "transparentModal", I want push one new Page of name "Profile", How shuld i do?
- [email protected] -> Compiling JS failed .... invalid expression Buffer
- Improve/Update React-Navigation SVGs
- Remove 'make me a sandwich' references from documentation .mov
- Use Deep Link, occur error
- React-native physical iOS devices not showing images
- NavigationContainer: initialRouteName: Issue with TypeScript
- Group Component Information HOT 2
- Nested navigation Snack Expample NOT FOUND
- Missing import on multiple-drawers
- Modal example issue - `RNSScreen` must be a function HOT 1
- Broken outbound URL HOT 1
- Remove mention of deprecated 'jest-native' in docs
- How to use the Drawer.CollapsedItem component with react-navigation/drawer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-navigation.github.io.