Comments (10)
@satya164 Fixed it by moving the key out of the props. My patch file from yarn:
diff --git a/src/TabBar.tsx b/src/TabBar.tsx
index e8d0b4c8dcbbe779fcd304f483d2d91c2d5e8dde..203adc927db153df3f8472d4ec67346e1cd7405b 100644
--- a/src/TabBar.tsx
+++ b/src/TabBar.tsx
@@ -364,8 +364,7 @@ export function TabBar<T extends Route>({
const renderItem = React.useCallback(
({ item: route, index }: ListRenderItemInfo<T>) => {
- const props: TabBarItemProps<T> & { key: string } = {
- key: route.key,
+ const props: TabBarItemProps<T> = {
position: position,
route: route,
navigationState: navigationState,
@@ -446,9 +445,9 @@ export function TabBar<T extends Route>({
<>
{gap > 0 && index > 0 ? <Separator width={gap} /> : null}
{renderTabBarItem ? (
- renderTabBarItem(props)
+ renderTabBarItem({key: route.key, ...props})
) : (
- <TabBarItem {...props} />
+ <TabBarItem key={route.key} {...props} />
)}
</>
);
from react-navigation.
+1 and thanks for the patch @KrisLau
from react-navigation.
Hi @KrisLau, which version of react are you using? "react": "18.3.0"
gives me these errors but I don't have them with "react": "18.2.0"
. It's related to facebook/react#25697 after checking release notes https://github.com/facebook/react/releases/tag/v18.3.0
In my case for "@react-navigation/material-top-tabs": "6.6.13"
the file MaterialTopabView.tsx
is where the source of the error is:
return (
<TabView<Route<string>>
{...rest}
This version should have a peerDependency "react": "<=18.2.0"
as it will crash any Android release build (in my case) if the version is higher.
from react-navigation.
Yes, the warning appears with React 18.3.x. There is no crash for me and the React crew is promising that there is no changes apart of new deprecation warnings
from react-navigation.
Hey @KrisLau! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro.
The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.
You can provide a repro using any of the following:
- Expo Snack
- TypeScript Playground
- GitHub repo under your username
A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected.
Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information.
You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro.
from react-navigation.
Couldn't find version numbers for the following packages in the issue:
@react-navigation/native
react-native-tab-view
@react-navigation/bottom-tabs
@react-navigation/drawer
@react-navigation/material-top-tabs
@react-navigation/stack
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.
from react-navigation.
Couldn't find version numbers for the following packages in the issue:
@react-navigation/native
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.
from react-navigation.
@antoniogoulao I'm using v18.3.1. My Android builds are running fine on it but I'll make sure to keep an eye out for issues with it! My upgraded version is still sitting on a separate branch because I'm testing all the packages I upgraded haha.
from react-navigation.
Same issue here. Started happening after upgrading to v18.3.1
maybe the Solution given by @KrisLau could be implemented soon?
from react-navigation.
@linusrush you can use patch-package or yarn's built in patching to patch it in your project if you need it urgently
from react-navigation.
Related Issues (20)
- Unable to access elements rendered under drawer in Appium HOT 3
- App randomly freezes when react-native Modal is shown while preventing remove screen with usePreventRemove on iOS HOT 1
- When navigating to a stack, route state of this stack is undefined HOT 4
- Nested Navigation Gesture issues HOT 3
- iOS App Crashes on navigation to previous screen HOT 2
- Drawer does not close after selecting item HOT 10
- Indicator borderRadius doesn't work with tabBarItemStyle width: 'auto' HOT 1
- [Android] Screen get dimmed after navigate? HOT 3
- Issue with initial index HOT 2
- Modal not displaying on iOS when navigating from screen that is more than 1 screen away
- Invariant Violation: requireNativeComponent: "LEGACY_RNCViewPager" was not found in the UIManager. HOT 10
- Removing first tab screen
- createMemoryHistory always keeps current hash even if replacement has a hash HOT 4
- incompatible types HOT 1
- Incorrect types
- Unexpected tab label color change during tab change animation (react-native-tab-view) HOT 1
- I can't push and pop Stack.Group, only replace HOT 2
- navigation.goBack() crash the app only in iPhone 15 when using '@react-navigation/native-stack' HOT 2
- transparentModal doesn't appear on the screen although it is rendered due to which the whole app becomes unresponsive after upgrading from react-native 0.72.5 to 0.73.8 HOT 5
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.