title: Externalise common functions in various react components
body: <p>In different <code>components</code> where I use the same functions when it comes to styling or something else. Some of these functions use <code>this.setState({...});</code> I want to collect all these functions in a common place, so when rewriting them I don't have to rewrite them in all the components, but only on one file. However, I do not know how to write the <code>this.setState({...});</code> in the functions without loosing its context. Is there a way?</p>