title: How to create a reusable function in React
body: <p>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.</p>
  
  <p>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!</p>