DEV Community


Discussion on: Conceptual Gaps in Declarative Frontend Frameworks - Part 2 - Animations and Transitions Are Not "Nice To Have"

bytebodger profile image
Adam Nathaniel Davis

I've used the "react beautiful d-n-d" package (which is every bit as "beautiful" as its name implies) and of course, it's chuck full of imperative stuff as well.

Some of React's shortcoming are actually self-inflicted by the community. In other words, there's this ever-increasing trend to try to wash all of the "logic" out of components. They rant about the "evil" class keyword. And they worship at the alter of pure functions. And now they're in deep, spiritual, romantic love with hooks (which is funny, cuz hooks are basically a way to use functions - while keeping all of the horrible state stuff that everyone wanted to see removed from their classes). But all of that "logic" and all of that "state" in the components is what makes the declarative aspects of the render() function work. Or, to put it another way, everything in that class that's not in the render() function is the imperative spice that makes the declarative dish appealing.