Open MohamedJerbi opened 2 years ago
I am running into this same error.
same here..
This issues happens in react-navigation
as well
I've disabled these lines and it works as expected. at this file File
// React.createElement = WrapJsx(React.createElement);
// JsxDev.jsx && /* */ (JsxDev.jsx = WrapJsx(JsxDev.jsx));
// JsxPro.jsx && /* */ (JsxPro.jsx = WrapJsx(JsxPro.jsx));
// JsxDev.jsxs && /* */ (JsxDev.jsxs = WrapJsx(JsxDev.jsxs));
// JsxPro.jsxs && /* */ (JsxPro.jsxs = WrapJsx(JsxPro.jsxs));
// JsxDev.jsxDEV && /**/ (JsxDev.jsxDEV = WrapJsx(JsxDev.jsxDEV));
// JsxPro.jsxDEV && /**/ (JsxPro.jsxDEV = WrapJsx(JsxPro.jsxDEV));
So, I suggest to disable these lines at ios
and android
platforms. @JoviDeCroock
Facing the same issue with a BottomTabNavigator in React Native. Disabling the lines as mentioned above didnt work for me either.
Facing the same problem.
I fixed this issue (it works for 1.2.1 version). You need to apply this patch for @react-navigation/core:
diff --git a/node_modules/@react-navigation/core/src/Group.tsx b/node_modules/@react-navigation/core/src/Group.tsx
index 352ba31..893d2c2 100644
--- a/node_modules/@react-navigation/core/src/Group.tsx
+++ b/node_modules/@react-navigation/core/src/Group.tsx
@@ -12,3 +12,4 @@ export default function Group<
/* istanbul ignore next */
return null;
}
+Group.__isGroup = true;
\ No newline at end of file
diff --git a/node_modules/@react-navigation/core/src/Screen.tsx b/node_modules/@react-navigation/core/src/Screen.tsx
index 4ca4306..f116e61 100644
--- a/node_modules/@react-navigation/core/src/Screen.tsx
+++ b/node_modules/@react-navigation/core/src/Screen.tsx
@@ -15,3 +15,4 @@ export default function Screen<
/* istanbul ignore next */
return null;
}
+Screen.__isScreen = true;
\ No newline at end of file
diff --git a/node_modules/@react-navigation/core/src/useNavigationBuilder.tsx b/node_modules/@react-navigation/core/src/useNavigationBuilder.tsx
index 76442df..e1c8632 100644
--- a/node_modules/@react-navigation/core/src/useNavigationBuilder.tsx
+++ b/node_modules/@react-navigation/core/src/useNavigationBuilder.tsx
@@ -93,7 +93,7 @@ const getRouteConfigsFromChildren = <
ScreenConfigWithParent<State, ScreenOptions, EventMap>[]
>((acc, child) => {
if (React.isValidElement(child)) {
- if (child.type === Screen) {
+ if (child.type?.__isScreen) {
// We can only extract the config from `Screen` elements
// If something else was rendered, it's probably a bug
@@ -121,7 +121,7 @@ const getRouteConfigsFromChildren = <
return acc;
}
- if (child.type === React.Fragment || child.type === Group) {
+ if (child.type === React.Fragment || child.type?.__isGroup) {
if (!isValidKey(child.props.navigationKey)) {
throw new Error(
`Got an invalid 'navigationKey' prop (${JSON.stringify(
The error is easy to replicate. packadge.json
How to reproduce.
import {Signal, signal} from '@preact/signals-react'; import {User} from '../types';
const user: Signal = signal(null);
// get from session storage?
export const initialRouteName = user ? 'BottomTab' : 'Login';
export default user;
This error is located at: in NativeStackNavigator (created by App) in EnsureSingleNavigator in BaseNavigationContainer in ThemeProvider in NavigationContainerInner (created by App) in App (created by Main) in ThemeProvider (created by Provider) in RCTView (created by View) in View (created by Portal.Host) in Portal.Host (created by Provider) in Provider (created by Main) in Main in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer in thedoc(RootComponent), js engine: hermes