Problem using a Monx store with HyperMoon created component
See original GitHub issuevar testComp = m('h1', { attrs: {} }, { shouldRender: false }, [m("#text", { shouldRender: true }, store.state.selectedTool)]); // <--- Does not get updated
Moon.component("foo-component", {
render: function(m) {
return testComp;
}
});
Other components work well with the store. I have tried setting both “shouldRender” values to true, that did not work either. Any idea what I am doing wrong?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Defining data stores - MobX
The main responsibility of stores is to move logic and state out of your components into a standalone testable unit that can be...
Read more >Way of Creating multiple stores with mobx and injecting it into ...
Is it the correct and efficient way to inject the root store every time to the component even if it needs a part...
Read more >Correct way of Creating multiple stores with mobx and ...
Question 1: What's the best way to organise stores and inject them into the component? Approach 1: App.js. // Root Store Declaration class ......
Read more >Mobx Root Store Pattern with React Hooks
Root store pattern is a simple pattern that the Mobx community started to use whenever there were multiple Mobx stores (which are just ......
Read more >Introduction to MobX with React - LogRocket Blog
Demonstration: Using MobX to create a store ... We can solve the above issue by making React components aware of updates in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes I am, like this:
Everything works except this component with the HyperMoon created template. The only thing that might have an influence is that I have at least 8 components in the same scope, all registered to the same store. I will try to create a fiddle as soon as possible.
Awesome, if you’d like to generate a function to start off with, check out
Moon.compile
. Let me know if all of them work.