Reflux 5.x components do not update from store if componentWillMount or componentWillUnmount are defined

Ran into a strange scenario where I could not get a component to update with data from a Reflux when I defined a componentWillMount() or componentWillUnmount() function. Just a simple console.log() made it stop working. I commented that out, and it still did not work.

The cause was that since the component extends from Reflux (instead of React), that it has to call those functions for the parent to enable the reflux store hooks. But, calling super() gave me an error that it isn’t valid outside of the constructor function. And dumping the super object just threw an error.

So how do you call the parent function?

super.componentWillMount()

super.componentWillUnmount()

That makes the rest of the component function as expected.