Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const [a, setA] = useState(null)
- const callback = () => {
- if(a) {
- alert(a) // null
- }
- }
- alert(a) // 1
- useEffect(() => {
- if(true) {
- setA(1)
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement