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
loaderDataand which use justdata: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
dataproperties be explicitly named eitherloaderDataoractionDatato reflect what their actual data represents.This could be done incrementally (as suggested by @MichaelDeBoey on Discord):
loaderDataandactionDatawhere needed as a duplicate property for the existing ambiguousdatadataas@deprecateddatain a future major versionBeta Was this translation helpful? Give feedback.
All reactions