mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-14 11:45:33 +00:00
Memoize refs
Refs can be memoized following the fix in the previous commit. Fix #1755 Fix #1665
This commit is contained in:
@@ -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]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user