react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Inline styles draft

Open graszka22 opened this issue 2 years ago • 0 comments

Description

This PR adds support for animations in inline styles.

Changes

  • Added withInlineStyles HOC and applied it to component returned by createAnimatedComponent
  • Added some data to animations created by defineAnimation. It's needed to call animations in useAnimatedStyle within withInlineStyles
  • 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

graszka22 avatar Jul 04 '22 12:07 graszka22