motion-on-native 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +10 -10
- package/lib/index.js +3 -3
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -76,14 +76,14 @@ export interface MotionComponentProps {
|
|
|
76
76
|
children?: React.ReactNode;
|
|
77
77
|
}
|
|
78
78
|
export declare const NativeMotion: {
|
|
79
|
-
View:
|
|
80
|
-
Text:
|
|
81
|
-
Image:
|
|
82
|
-
ImageBackground:
|
|
83
|
-
TextInput:
|
|
84
|
-
TouchableOpacity:
|
|
85
|
-
ScrollView:
|
|
86
|
-
FlatList:
|
|
87
|
-
SectionList:
|
|
88
|
-
Pressable:
|
|
79
|
+
View: React.ForwardRefExoticComponent<MotionComponentProps & import("react-native").ViewProps & React.RefAttributes<any>>;
|
|
80
|
+
Text: React.ForwardRefExoticComponent<MotionComponentProps & import("react-native").TextProps & React.RefAttributes<any>>;
|
|
81
|
+
Image: React.ForwardRefExoticComponent<MotionComponentProps & import("react-native").ImageProps & React.RefAttributes<any>>;
|
|
82
|
+
ImageBackground: React.ForwardRefExoticComponent<MotionComponentProps & import("react-native").ImageBackgroundProps & React.RefAttributes<any>>;
|
|
83
|
+
TextInput: React.ForwardRefExoticComponent<MotionComponentProps & import("react-native").TextInputProps & React.RefAttributes<any>>;
|
|
84
|
+
TouchableOpacity: React.ForwardRefExoticComponent<Omit<MotionComponentProps & import("react-native").TouchableOpacityProps & React.RefAttributes<View>, "ref"> & React.RefAttributes<any>>;
|
|
85
|
+
ScrollView: React.ForwardRefExoticComponent<MotionComponentProps & import("react-native").ScrollViewProps & React.RefAttributes<any>>;
|
|
86
|
+
FlatList: React.ForwardRefExoticComponent<MotionComponentProps & import("react-native").FlatListProps<unknown> & React.RefAttributes<any>>;
|
|
87
|
+
SectionList: React.ForwardRefExoticComponent<MotionComponentProps & import("react-native").SectionListProps<unknown, unknown> & React.RefAttributes<any>>;
|
|
88
|
+
Pressable: React.ForwardRefExoticComponent<Omit<MotionComponentProps & import("react-native").PressableProps & React.RefAttributes<View>, "ref"> & React.RefAttributes<any>>;
|
|
89
89
|
};
|
package/lib/index.js
CHANGED
|
@@ -57,7 +57,7 @@ const DEFAULT_TRANSITION = {
|
|
|
57
57
|
repeatType: 'loop',
|
|
58
58
|
};
|
|
59
59
|
function createMotionComponent(Component) {
|
|
60
|
-
return
|
|
60
|
+
return react_1.default.forwardRef((props, ref) => {
|
|
61
61
|
const { initial = {}, animate = {}, exit = {}, // Future Implementation
|
|
62
62
|
transition = DEFAULT_TRANSITION, whileHover, // Future Implementation
|
|
63
63
|
whileTap, // Future Implementation
|
|
@@ -247,8 +247,8 @@ function createMotionComponent(Component) {
|
|
|
247
247
|
return style;
|
|
248
248
|
});
|
|
249
249
|
const AnimatedComponent = react_native_reanimated_1.default.createAnimatedComponent(Component);
|
|
250
|
-
return react_1.default.createElement(AnimatedComponent, Object.assign({ style: [styles, animatedStyle] }, rest), children);
|
|
251
|
-
};
|
|
250
|
+
return react_1.default.createElement(AnimatedComponent, Object.assign({ ref, style: [styles, animatedStyle] }, rest), children);
|
|
251
|
+
});
|
|
252
252
|
}
|
|
253
253
|
function getInitialValue(key, initial) {
|
|
254
254
|
if (initial === false) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motion-on-native",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Framer Motion-inspired animation library for React Native with Reanimated. Easy spring animations, gestures, and transitions for mobile apps.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|