Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardReactrender bailout Object.isSingle-choice MCQ

useState bails out when Object.is(prev, next) is true. For the setter call below where state is the number 0, what happens and why?

const [n, setN] = useState(0); // later, in an event handler: setN(-0);