Sharing context between components #63
JordanMarr
started this conversation in
General
Replies: 1 comment
-
there's nothing baked in for that, but my answer here kind of explains my thoughts behind this I think we can attempt something like a custom hook that uses Fable.Store or a similar mechanism under the hood, quoting myself from there:
|
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
-
What do you think would be the best way to handle state shared between components when using Fable.Lit with hook components with their own state (and not using global elmish loop)?
Obviously you can "prop drill" and pass from parent into child components, but that can become problematic.
In React, it is common to use the
useContext
hook. What might this look like in Fable.Lit?Asking for me, and also because someone asked me and my response was to "use global elmish loop", which isn't the best answer if you like to have more stateful components.
@AngelMunoz
Beta Was this translation helpful? Give feedback.
All reactions