Skip to content

Commit

Permalink
WithReanimated#forwardRef#2
Browse files Browse the repository at this point in the history
  • Loading branch information
ilz5753 committed Dec 14, 2023
1 parent af33e4e commit cab8bcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ilz5753/rnutils",
"version": "0.1.5",
"version": "0.1.6",
"description": "React Native Utils",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
6 changes: 3 additions & 3 deletions src/dynamicStyles/reanimated.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { isEqual, isFunction } from 'lodash';
import React, {
Component,
forwardRef,
useEffect,
type ComponentType,
forwardRef,
type ForwardRefExoticComponent,
type PropsWithoutRef,
type RefAttributes,
Expand All @@ -30,9 +30,9 @@ import Animated, {
useAnimatedStyle,
useDerivedValue,
useSharedValue,
type AnimateProps,
type DerivedValue,
type SharedValue,
type AnimateProps,
} from 'react-native-reanimated';
export type CustomDimensionValue = number | `${number}%`;
export type StrNum = string | number;
Expand Down Expand Up @@ -662,7 +662,7 @@ export function WithAnimated<T extends object>(
}
let _Component = isFunction(Comp) ? Class<T> : Comp;
let Render = $(_Component) as any;
return forwardRef((props: Readonly<Animated.AnimateProps<T>>, ref) => (
return forwardRef<T, Readonly<AnimateProps<T>>>((props, ref) => (
<Render {...{ layout: Layout, ...props, ref }} />
));
}
Expand Down

0 comments on commit cab8bcf

Please sign in to comment.