Skip to content

<Outlet /> throws an Error in Console for the nested route #13044

@laolarou726

Description

@laolarou726

I'm using React Router as a...

library

Reproduction

In the nested route, <Outlet /> throws the error:

Invalid prop `style` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props. Error Component Stack
    at div (<anonymous>)
    at Card (defaultProps.ts:35:7)
    at div (<anonymous>)
    at Col (css.js:75:7)
    at div (<anonymous>)
    at Row (defaultProps.ts:102:7)
    at div (<anonymous>)
    at Component (<anonymous>)
    at RenderedRoute (chunk-IR6S3I6Y.mjs:4368:26)
    at Outlet (chunk-IR6S3I6Y.mjs:4989:26)
    at div (<anonymous>)
    at div (<anonymous>)
    at div (<anonymous>)
    at div (<anonymous>)
    at UserPageBaseElement (UserPageBaseElement.tsx:21:33)
    at RenderedRoute (chunk-IR6S3I6Y.mjs:4368:26)
    at Outlet (chunk-IR6S3I6Y.mjs:4989:26)
    at App (App.tsx:16:27)

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (24) x64 Intel(R) Core(TM) Ultra 9 285K
    Memory: 61.77 GB / 95.27 GB
  Binaries:
    Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (133.0.3065.51)

Used Package Manager

yarn

Expected Behavior

The navigation is fine. But it will throw the error every time I switch the route.

Actual Behavior

It will throw the error every time I switch the route.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions