Each file should define a single (i.e. one) React component.
Expose a single state attribute named data that is an immutable map.
When state changes, rebuild the immutable map.
getInitialState: function () {
return { data: Immutable.Map({ ... }); }
}
Good points. I'm struggling with finding the sweet spot of how much to break the app up into separate files.
On top of that, I've discovered a friendly way to use RequireJS with Rails. But now I need to decide how many pre-compiled assets to create vs individual JavaScript files to load as modules. Though having all the options is quite nice. https://medium.com/@hopsoft/requirejs-rails-73e7050cf173