Hacker News new | past | comments | ask | show | jobs | submit login

I agree with you for most of that, though I have definitely run into cases of "React" as a paradigm getting in the way. I'd love if someone here has a good solution.

The inherent problem I run into with React is that it's "context-less", in the sense that the "React way of thinking" makes it hard to represent things like animations where you care about the previous state and how you got there. So in my case, I'm doing a multiplayer boardgame. Someone plays a card, I want to animate the card getting pulled from one deck and shuffled into another.

The best solution I've found so far is to add extra "annotations" (using terms loosely) into the current "board state" that represents the changes that happened, and that allows me to queue up the necessary animations. But that feels clumsy because it means persisting stateful data into the data structure alongside the actual "pure board state".




Well without knowing the specifics of your use case, the two most practical react packages for animation I've used have been react-move and CssTransitionGroup.

They both work on the principle of toggling the animation based on a property "show". It's pretty great!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: