Search code examples
redux

What's the actual downside of storing functions / components on Redux?


I would like to store a function / component inside the Redux state to pass it to another part of the application.

I've read that this is not recommended, but what exactly will happen?

  • Will it affect the performance of other data stored on Redux to the point it becomes visibly slow to the user?
  • Will it cause components that depend on this component or any data stored on Redux to continuously re-render causing the app to slow to a crawl?
  • Will Redux just break randomly all the time?

What are the actual, practical downsides to doing this, putting aside the intentions behind the creation of the library?


Solution

  • I've decided to just store the component I needed on Redux and haven't seen any downsides, which led me to believe there is no real issue in doing this, as long as you don't care about serialization.