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 20, 2020
1 parent 6d6f7d7 commit 4dfdee4
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 4dfdee4

Please sign in to comment.