Skip to content

Error in Expo Router on Web caused by EventProvider in Layout #374

@60pfennig

Description

@60pfennig

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions