© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Why does react rerender this at the component level but not when using a hook? - Theo's Typesafe Cult
TTC
Theo's Typesafe Cult
•
4y ago
•
20 replies
jakeman
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
.
CodeSandbox
damp-moon-v24dzf - CodeSandbox
damp
-moon
-v24dzf using react
, react
-dom
, react
-scripts
Theo's Typesafe Cult
Join
27,305
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
tRPC React - why the useState hook?
TTC
Theo's Typesafe Cult / questions
4y ago
Preventing Rerender of Parent component in React
TTC
Theo's Typesafe Cult / questions
3y ago
How does the top-level hook rule work within other hooks?
TTC
Theo's Typesafe Cult / questions
3y ago
Using Vitest to test React component that uses custom hook
TTC
Theo's Typesafe Cult / questions
3y ago