Thank you for the post, there's not a ton of talk on using iterators with react state and they have a great potential to create state machines. Why put the iterator into the static context? While this works well for global state management, wouldn't this break down once you rendered two different instances of the same component?
Thank you for the post, there's not a ton of talk on using iterators with react state and they have a great potential to create state machines. Why put the iterator into the static context? While this works well for global state management, wouldn't this break down once you rendered two different instances of the same component?
Why not something along the lines of:
The fear that I have with the above implementation is that the iterator is in state... and it's getting mutated! Which is bad!
That being said, it does "work." Is there a better pattern or lib out there that could avoid mutating a value in state?