Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem using a Monx store with HyperMoon created component

See original GitHub issue
var 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:closed
  • Created 6 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

kokujincommented, Aug 20, 2017

Yes I am, like this:

$(function() {
    // HyperMonn
    const m = Moon.util.m;

    // Init Moon plugins

    const store = new Monx({.....

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.

kbrshcommented, Aug 22, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found