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

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}'`



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"




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: