Skip to content

Commit

Permalink
Memoize refs
Browse files Browse the repository at this point in the history
Refs can be memoized following the fix in the previous commit.

Fix #1755
Fix #1665
  • Loading branch information
necolas committed Oct 7, 2020
1 parent b432273 commit 583e16f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react-native-web/src/modules/useMergeRefs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ import mergeRefs from '../mergeRefs';

export default function useMergeRefs(...args: $ReadOnlyArray<React.ElementRef<any>>) {
// TODO(memoize) #1755
return /*React.useMemo(() => */ mergeRefs(...args) /*, [args])*/;
return React.useMemo(
() => mergeRefs(...args),
// eslint-disable-next-line
[...args]
);
}

0 comments on commit 583e16f

Please sign in to comment.