I'm building a project management app and I'm still struggling with a question - what to store in Redux state and what load "on demand".
Is there any known "maximum recommended size" of a Redux state? Dozens of kilobytes, hundreds of kilobytes, units of megabytes, ...?
Keep in mind that, at the end of the day, Redux is just a paradigm for "how" to save your information in memory. It doesn't add or reduce the amount of data you are keeping track of.
As an example: let's say your app was keeping track of to-do tasks. Before Redux, you had a React class of this pseudo-structure:
class TaskList {
state = { tasks: [] }
componentWillMount => goGetTheTasks().then(tasks => this.setState({ tasks }))
render = <div>{this.state.tasks.map()}</div>
}
With Redux, your store looks like this:
{
tasks: []
}
In both cases, you are saving the same data (the same tasks array) in memory.
Perhaps you could further share certain concerns that you have about your state growing too large. Also keep in mind that anything you can put in your store, you can take out of your store. And—you're not forced to put every byte inside your one store either. Still want to use component state for certain things? That's up to you—but you'll lose out on the advantages of having that data accessible from a central source.