Skip to content

Conversation

@Oksamies
Copy link
Contributor

For some weird reason, useRouteLoaderData in the root.tsx App function does not receive/update its
data when clientLoader is loaded. Changing to useLoaderData instead
seems to fix the issue.

For some weird reason, useRouteLoaderData in the root.tsx App function does not receive/update its
data when clientLoader is loaded. Changing to useLoaderData instead
seems to fix the issue.
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
Copy link

coderabbitai bot commented Oct 21, 2025

Walkthrough

The root loader data retrieval in apps/cyberstorm-remix/app/root.tsx was refactored to use useLoaderData() instead of useRouteLoaderData("root"). The RootLoadersType type definition remains consistent. This modifies how root loader data flows to the App component and its downstream dapper initialization. The change is contained to the data retrieval mechanism; error handling, control flow, and the component structure are unaffected.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and specifically describes the fix being implemented: replacing the data retrieval mechanism to ensure Nimbus OutletContext receives updates when client data is loaded. This directly aligns with the actual change in root.tsx, where useRouteLoaderData is replaced with useLoaderData to resolve the data update issue. The title is concise, specific, and would help teammates understand the PR's purpose when scanning history.
Description Check ✅ Passed The description directly addresses the changeset by explaining the specific problem (useRouteLoaderData not receiving updates with clientLoader) and the solution implemented (switching to useLoaderData). It provides helpful context about why the change was necessary and references the affected file and function, making it clearly related to the actual modifications made. The description is concise but informative.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 10-21-fix_nimbus_outletcontext_not_being_updated_with_client_data

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed81119 and ca884f5.

📒 Files selected for processing (1)
  • apps/cyberstorm-remix/app/root.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Generate visual diffs
🔇 Additional comments (1)
apps/cyberstorm-remix/app/root.tsx (1)

582-582: Correct fix for clientLoader data flow.

Using useLoaderData() directly in the root component is the proper approach and aligns with how the Layout component accesses the same data (line 209). This should properly receive updates from both server and client loaders.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 9.89%. Comparing base (ed81119) to head (ca884f5).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
apps/cyberstorm-remix/app/root.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1590   +/-   ##
======================================
  Coverage    9.89%   9.89%           
======================================
  Files         308     308           
  Lines       22497   22497           
  Branches      404     404           
======================================
  Hits         2225    2225           
  Misses      20272   20272           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Oksamies Oksamies requested a review from anttimaki October 23, 2025 10:44
Copy link
Contributor

@anttimaki anttimaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much time did you spend on trying to understand why useRouteLoaderData doesn't work? I.e. do you know what's the difference between the two approaches and how does the change affect the app aside from fixing this particular issue?

@Oksamies
Copy link
Contributor Author

How much time did you spend on trying to understand why useRouteLoaderData doesn't work? I.e. do you know what's the difference between the two approaches and how does the change affect the app aside from fixing this particular issue?

useRouteLoaderData as per the docs seems to only grab the loader data (which is weird if someone asks me) https://reactrouter.com/api/hooks/useRouteLoaderData

@Oksamies Oksamies merged commit 41d8862 into master Oct 24, 2025
28 of 31 checks passed
@Oksamies Oksamies deleted the 10-21-fix_nimbus_outletcontext_not_being_updated_with_client_data branch October 24, 2025 11:23
@anttimaki
Copy link
Contributor

How much time did you spend on trying to understand why useRouteLoaderData doesn't work? I.e. do you know what's the difference between the two approaches and how does the change affect the app aside from fixing this particular issue?

useRouteLoaderData as per the docs seems to only grab the loader data (which is weird if someone asks me) https://reactrouter.com/api/hooks/useRouteLoaderData

Kind of does what it says on the tin though?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants