Why does react rerender this at the component level but not when using a hook?
I've been toying with a type-writer effect in react and cant understand why react's lifecycle is working this way.
Can someone explain why react is re-rendering the <WithoutHook/> component such that it doesnt work
While the <WithHook/> one does?
https://codesandbox.io/s/damp-moon-v24dzf?file=/src/App.jsx
Notice 'strict mode' is on and if you disable it, it still breaks when not using a hook.
Can someone explain why react is re-rendering the <WithoutHook/> component such that it doesnt work
While the <WithHook/> one does?
https://codesandbox.io/s/damp-moon-v24dzf?file=/src/App.jsx
Notice 'strict mode' is on and if you disable it, it still breaks when not using a hook.

