react-native-reanimated
react-native-reanimated copied to clipboard
Inline styles draft
Description
This PR adds support for animations in inline styles.
Changes
- Added
withInlineStyles
HOC and applied it to component returned bycreateAnimatedComponent
- Added some data to animations created by
defineAnimation
. It's needed to call animations inuseAnimatedStyle
withinwithInlineStyles
- Updated
withTiming
,withSpring
,withDecay
types - Moved
flattenArray
to utils - Moved
AnimatedComponentProps
to a separate file to avoid circular dep
Test code and steps to reproduce
const width = useSharedValue(0);
<Animated.View style={{ width: withSpring(width) }} />
<Animated.View style={{ width: width }} />
Checklist
- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes