This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const [count, setCount] = useState(0) | |
| const [slowCount, setSlowCount] = useState(0) | |
| const [isToggled, setIsToggled] = useState(false) | |
| useFocusEffect( | |
| useCallback(() => { | |
| console.log('slowCount useEffect ran') | |
| const interval = setInterval(() => { | |
| console.log('slow count incremented') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const [count, setCount] = useState(0) | |
| const [slowCount, setSlowCount] = useState(0) | |
| const [isToggled, setIsToggled] = useState(false) | |
| useEffect(() => { | |
| console.log('slowCount useEffect ran') | |
| const interval = setInterval(() => { | |
| console.log('slow count incremented') | |
| setSlowCount((prevState) => prevState + 1) |