News for hackers. Stuff that matters.
Re:CSS Houdini by axiosgunnar on Wednesday May 12, 2021 @02:18PM (#27133435)
But what I meant that I liked about hooks is the "automatic rerender" in React, the reason this feature is called "hooks". I'm not sure simply declaring a method on a class would be the same?
Re:CSS Houdini by moshmosh on Wednesday May 12, 2021 @02:30PM (#27133554)
If you operate under the same restrictions as React (single-threaded, you must call a setter method to modify properties rather than accessing them directly, code outside your class is responsible for deciding whether to call its "render" method) then yes, it's the same. Change any of those and it gets harder in basically the same way it would for Hooks if any of those changed.