Data Loading Strategies #123
thescientist13
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
WCC currently supports data loading through a couple different strategies
Loader Function
Any component can export a
getData
function, which is pretty versatile and works at the definition level, anywhere in the tree.Constructor Props
In #119 we allowed it so a "constructor prop" could be passed in programmatically when calling
renderToString
for the entry point moduleThis pattern plays really nice with file-based routing and SSR!
How do we feel about these patterns? Should we keep both, or drop one or the other? Or something altogether different? 🤔
Should this also apply to
renderFromHTML
?Technically, I suppose you could combine them anyway you see fit? Seems like they could serve different use cases.
Beta Was this translation helpful? Give feedback.
All reactions