Replies: 1 comment 1 reply
-
This simply looks like you either prefer using a Context / Provider pattern or you have been using react for some time and got used to it 😄 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What problem is this solving
It's not that much of a problem .. But I am of that kind of people who feel it a tedious process to import the useStore and execute it to just use a single state item inside the template.
Proposed solution
A built-in renderless data provider component which passes the store to the template through a the default slot. In fact I use this method inside my projects but it would be good if there is a built-in component for this purpose.
Define a renderless data-provider component
Import the component globally
Use the provider inside your app
Describe alternatives you've considered
It would be very nice if this component has a props to accept the name of the store to dynamically import and provide it.
Beta Was this translation helpful? Give feedback.
All reactions