React for idle/incremental game
Hello r/reactjs!
I'm a beginner in React and wanna try to make something up for my holiday project, and got an idea of making an idle/incremental game, like Cookie Clicker. I'm planning to use Redux to store the data and easily spread the data to the components that need it (tracking money and upgrades to 'upgrade shop' container that will receive Redux state as props).
Haven't made it yet, I'm thinking if this would be a good idea, implementing this game with React/Redux, while in most of idle/incremental games, the money gets updated very fast, lets say perhaps every 100ms or even faster (I'm not sure about this). Of course there are other ways to implement this game without having the 100ms timer ticking to update the money count (1s timer instead, or 4s timer for a 4 second 'factory' that user have), but I still want to try on making the update fast enough.
I have encountered an infinite render loop through my learning process, and from my experience it slows down my browser until it become sort of unresponding. I think this game will also share the same problem, by means constantly re-render its components with no sign of stopping, for every 100ms.
The question is, can I actually have a way to build this with React/Redux and get seamless performance, just like other good similar games? Or if it's bad, perhaps there are other libraries or technologies to implement this while still making use of React?
Thanks!
Posted Jan 11, 2019, 3:26 PM UTC
I'd think it would be fine, best way is to try
Will be updating when I have built it, thanks!