Skip to content

Commit

Permalink
wrap in effect
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jun 18, 2020
1 parent 736c635 commit baafa5b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ export default function useBlockSync( {
// waiting for React renders for changes.
const onInputRef = useRef( onInput );
const onChangeRef = useRef( onChange );
onInputRef.current = onInput;
onChangeRef.current = onChange;
useEffect( () => {
onInputRef.current = onInput;
onChangeRef.current = onChange;
}, [ onInput, onChange ] );

useEffect( () => {
const {
Expand Down

0 comments on commit baafa5b

Please sign in to comment.