| 35 | const [isClicked, setIsClicked] = useState(false); |
| 36 | const [isFocused, setIsFocused] = useState(false); |
| 37 | const onClick = () => { |
| 38 | setIsClicked(true); |
| 39 | const el = buttonRef.current; |
| 40 | el.focus(); |
| 41 | // The update triggered by the focus event should not have flushed yet. |
| 42 | // Nor the click update. They would have if we had wrapped the focus |
| 43 | // call in `flushSync`, though. |
| 44 | Scheduler.log('Value right after focus call: ' + el.innerHTML); |
| 45 | }; |
| 46 | const onFocus = () => { |
| 47 | setIsFocused(true); |
| 48 | }; |