Hacker News new | ask | show | jobs
by _thisdot 1189 days ago
Far as I see they aren't. They're recommending you don't use unnecessary state. From the example, if you have state for `firstName` and `lastName`, you don't need another state for `fullName`. Just calculate it during the render as `'${firstName} ${lastName}'`
1 comments

They're referring to https://react.dev/learn/you-might-not-need-an-effect#adjusti..., where they literally call setFoor in the render method.

I guess this makes sense, but it's weird after all the "never do anything stateful in render"