News for hackers. Stuff that matters.
Re:React: You Might Not Need an Effect by quickthrower2 on Thursday March 23, 2023 @04:18PM (#35280723)
I think I agree. I commented a while back I prefer components that don’t reset state based on props anyway.

Use state as little as possible and keep things pure and you probably won’t need this.

Example: date picker only keeps the open/close ui state of the picker. The date is a prop and date change is an event.

Instead of original date being a prop. Current date being local state.

There are no comments on this comment yet.