-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Description
Discussed in #13934
Originally posted by rossipedia July 4, 2025
There's a bit of an inconsistency in which types use loaderData and which use just data:
CreateMetaArgsusesdatafor the loader dataCreateHydrateFallbackPropsusesloaderDataandactionDataCreateComponentPropsusesloaderDataandactionDataMatchusesdatato mean "loader data"MetaMatchalso usesdatato mean "loader data"
Inconsistent names are harder to reason about, and harder to work with when code-modding larger codebases. There's a bit of extra cognitive overhead too ("Data? Is this loader data? Action data? wait... which one even makes sense in this context? hmmm")
I propose all data properties be explicitly named either loaderData or actionData to reflect what their actual data represents.
This could be done incrementally (as suggested by @MichaelDeBoey on Discord):
- Introduce
loaderDataandactionDatawhere needed as a duplicate property for the existing ambiguousdata - Mark
dataas@deprecated - Remove
datain a future major version
Metadata
Metadata
Assignees
Type
Projects
Status
Stage 5 - Stable