I'm a quite new to React so sorry if this is a simple question. I have a bunch of components, and for each component I would like to specify an initial state for each of {b: this.constructor.displayName} ("b" is to be used when building classNames). Rather than define b in "getInitialState" initial state in every component, I would like to define some reusable function to set b everywhere.
From my early research it seems like mixins might be promising. However, I've also read that mixins are on their way out. What is the best way to do this? Thanks in advance!
redux
, this would allow you to have a global state that all components can access (if requested). redux.js.org/docs/basics/ExampleTodoList.html - At first it may seem hard to get your head around but eventually you'll understand it :)