DEV Community

Discussion on: Autosaving with React Hooks

Collapse
 
kelsonpw profile image
Kelson Warner

Since lastText is never used in render/UI, wouldn’t using a ref instead of state for storing prev state save extra renders?

Collapse
 
wolverineks profile image
Kevin Sullivan

it looks like lastText != text is doing the same thing as [text], so everything lastText could probably be removed