Skip to content

Loader data passed to component gets undefined error #14231

@dizzyjaguar

Description

@dizzyjaguar

Reproduction

Link to a minimal reproduction
https://github.com/dizzyjaguar/rr7-bug

  • this bug wouldn't happen in Remix v2. Only after I migrated my Remix v2 app to React Router, did this happen.

System Info

System:
    OS: macOS 15.6
    CPU: (8) arm64 Apple M3
    Memory: 106.86 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
    bun: 1.1.8 - ~/.bun/bin/bun
  Browsers:
    Chrome: 139.0.7258.128
    Safari: 18.6
  npmPackages:
    @react-router/dev: ^7.7.1 => 7.8.2 
    @react-router/node: ^7.7.1 => 7.8.2 
    @react-router/remix-routes-option-adapter: ^7.8.2 => 7.8.2 
    @react-router/serve: ^7.7.1 => 7.8.2 
    react-router: ^7.7.1 => 7.8.2 
    vite: ^6.3.3 => 6.3.5

Used Package Manager

npm

Expected Behavior

Loader data, that shouldn't/isn't undefined, coming up undefined when passed to a component from the route page.

Actual Behavior

Getting a cannot map of undefined error in the component receiving the loader data as props. But the data is mappable in the route component itself .

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