-
In this beginning example i had a feeling that we must pass stores to components to be able to use it. It brings the idea of using context api.
However i tested that we do not need such. We can just import stores and use it where ever we want. For example below,
This works fine too and updates states and keeps the reactivity alright. I am confused that why would i pass the stores to the components. Is it something done on purpose ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Testability, reusability, SSR. |
Beta Was this translation helpful? Give feedback.
Testability, reusability, SSR.
If you import specific store instance, then your component is hardwired to that instance.
Otherwise doesn't matter.