Using the factory pattern with React Using the factory pattern with React reactjs reactjs

Using the factory pattern with React


Actually separating logic from presentation is pretty usual in React and considered best practise. So solution 2 is the way to go.

Your component A would then probably be a stateless function http://facebook.github.io/react/docs/reusable-components.html#stateless-functions whereas it's father would have only logic methods.

For your information, such a scheme is also the default way of using redux store, see http://redux.js.org/docs/basics/UsageWithReact.html#presentational-and-container-components