keske / react-native-easy-gestures

React Native Gestures. Support: Drag, Scale and Rotate a Component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I initialize component with styles

JasonXDDD opened this issue · comments

I have a original component and store its style with onEnd function

<Gestures style={{ position: 'absolute' }}
    onEnd={(event, styles) => {
        this.item.style = styles 
}}>
    <Image source={this.item.image} />
</Gestures>

however, I want to put this style to another component, for example

<Gestures style={{ position: 'absolute' }}
    onInit={this.item.style} // I want something like this to init with styles
>
    <Image source={this.item.image} />
</Gestures>

how can I do this?