how do I apply the transform-origin
property to a style in react native?
I\'ve tried in several ways, but I did not get an event
I tried:
I have made a lib to achieve transform-origin
. react-native-anchor-point
easy to use
import { withAnchorPoint } from 'react-native-anchor-point';
getTransform = () => {
let transform = {
transform: [{ perspective: 400 }, { rotateX: rotateValue }],
};
return withAnchorPoint(transform, { x: 0, y: 0.5 }, { width: CARD_WIDTH, height: CARD_HEIGHT });
};
<Animated.View style={[styles.blockBlue, this.getTransform()]} />
React native doesn't have any transform origin property yet. maybe in the future
but with a trick we can achieve this