Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No more loader data after clientLoader redirection #10194

Open
simonrelet opened this issue Nov 6, 2024 · 0 comments
Open

No more loader data after clientLoader redirection #10194

simonrelet opened this issue Nov 6, 2024 · 0 comments

Comments

@simonrelet
Copy link

Reproduction

https://stackblitz.com/edit/remix-run-remix-qwsqt5?file=app%2Froot.tsx

System Info

System:
  OS: macOS 14.6.1
  CPU: (8) arm64 Apple M2
  Memory: 1.64 GB / 24.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
  npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
Browsers:
  Brave Browser: 129.1.70.117
  Chrome: 130.0.6723.92
  Edge: 130.0.2849.68
  Safari: 17.6
npmPackages:
  @remix-run/dev: ~2.13.1 => 2.13.1
  @remix-run/eslint-config: ~2.13.1 => 2.13.1
  @remix-run/node: ~2.13.1 => 2.13.1
  @remix-run/react: ~2.13.1 => 2.13.1
  @remix-run/serve: ~2.13.1 => 2.13.1
  vite: ^5.4.10 => 5.4.10

Used Package Manager

npm

Expected Behavior

I would expect all useLoaderData calls to return the loader data instead of null.

Actual Behavior

  • Root has a loader
  • Layout has a clientLoader + HydrateFallback
  • Index has a loader

The layout clientLoader ensures the URL contains a search params p by throwing a redirection.

If you load the page without the URL search params (full page load), you'll see that root and index data become null but the layout route data in defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant