Consolidate on loaderData
name instead of data
for types
#13934
Closed
rossipedia
started this conversation in
Proposals
Replies: 3 comments 5 replies
-
I like it - 👍 from me |
Beta Was this translation helpful? Give feedback.
5 replies
-
This is available in |
Beta Was this translation helpful? Give feedback.
0 replies
-
Roadmap issue created: #14052 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There's a bit of an inconsistency in which types use
loaderData
and which use justdata
:CreateMetaArgs
usesdata
for the loader dataCreateHydrateFallbackProps
usesloaderData
andactionData
CreateComponentProps
usesloaderData
andactionData
Match
usesdata
to mean "loader data"MetaMatch
also usesdata
to 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 eitherloaderData
oractionData
to reflect what their actual data represents.This could be done incrementally (as suggested by @MichaelDeBoey on Discord):
loaderData
andactionData
where needed as a duplicate property for the existing ambiguousdata
data
as@deprecated
data
in a future major versionBeta Was this translation helpful? Give feedback.
All reactions