react-native-outside-press icon indicating copy to clipboard operation
react-native-outside-press copied to clipboard

Error in Expo Router on Web caused by EventProvider in Layout

Open 60pfennig opened this issue 1 year ago • 0 comments

Only on Web, Android working. Tested other Providers which are working fine so the cause seems to be the Event Provider. If you wrap your navigator in your _layout.tsx like this:

const Layout = () => {
  return (
    <EventProvider>
      <Stack>
        <Stack.Screen name="individual" options={{ headerShown: false }} />
        <Stack.Screen name="group" options={{ headerShown: false }} />
      </Stack>
    </EventProvider>
  );
};


export default Layout;

You get:

Uncaught Error: <Screen /> component in `default export` at `app/report/_layout` must not have a `children`, `component`, or `getComponent` prop when used as a child of a Layout Route

    withLayoutContext.js:21
    React 4
    useFilterScreenChildren withLayoutContext.js:14
    React 3
    useFilterScreenChildren withLayoutContext.js:12
    Navigator withLayoutContext.js:54
    React 13
    withLayoutContext.js:21:30
    withLayoutContext.js:21
    React 4
    useFilterScreenChildren withLayoutContext.js:14
    React 3
    useFilterScreenChildren withLayoutContext.js:12
    Navigator withLayoutContext.js:54
    React 13

60pfennig avatar Nov 07 '24 12:11 60pfennig