| 1 | // @enablePreserveExistingMemoizationGuarantees |
| 2 | import {useCallback, useRef} from 'react'; |
| 3 | |
| 4 | function Component(props) { |
| 5 | const ref = useRef(null); |
| 6 | |
| 7 | const onChange = useCallback(event => { |
| 8 | // The ref should still be mutable here even though function deps are frozen in |
| 9 | // @enablePreserveExistingMemoizationGuarantees mode |
| 10 | ref.current = event.target.value; |
| 11 | }); |
| 12 | |
| 13 | return <input onChange={onChange} />; |
| 14 | } |
| 15 | |
| 16 | export const FIXTURE_ENTRYPOINT = { |
| 17 | fn: Component, |
| 18 | params: [{}], |
| 19 | }; |