Skip to content
RED SAGSkills
easy5 pts · first answer countsreact-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