Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumReactcustom hooksSingle-choice MCQ

Two components call the same custom hook useCounter(). Does calling the hook in both share one counter between them?

function useCounter() { const [count, setCount] = useState(0); return [count, () => setCount(c => c + 1)]; }