Skip to content
RED SAG Skills
easyStudy question · answer published in React interview questions, so no pointsreact-nativereact-state

Calling setCount twice

In this React Native component, count starts at 0. What is count after the user presses the button once?

const [count, setCount] = useState(0)

const onPress = () => {
  setCount(count + 1)
  setCount(count + 1)
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions