arrow_backBACK TO DRILLS
Black Beltreconciliation-keysPREMIUM
Toggling between Two Branches Rendering the Same Component
Two sibling branches of a conditional render both return a Counter component at the same JSX position.
REACT_MODULE // 0x42
function App({ isDark }) {
return (
<div>
{isDark ? <Counter theme="dark" /> : <Counter theme="light" />}
</div>
);
}When isDark toggles and the app re-renders, does Counter's internal state (like a count from useState) reset or persist?