dancormier / react-native-swipeout

iOS-style swipeout buttons behind component
MIT License
2.62k stars 645 forks source link

Will setNativeProps works for external libraries as well? #321

Closed Yandamuri closed 4 years ago

Yandamuri commented 5 years ago

Direct Manipulation can be done by using setNativeProps with out Re-render.But it's working fine with react-native components. Where as when I tired to use with external libraries it's throwing an error.

I am using react-native-swipeout

   <Swipeout
            ref={ ref => this.Swipeout = ref}
            backgroundColor={'transparent'} 
            right={swipeoutBtns}
            scroll={(scrollEnabled) => this.onSwipe(scrollEnabled)}
            sensitivity={1}
            buttonWidth={70}
    >
           <Text>Swipe Here</Text>
    </Swipeout>

It has a prop called close which should be true later at some point of time. I am setting to true as follows,

this.Swipeout.setNativeProps({ close: true });

but, it's throwing following error,

this.Swipout.setNativeProps is not a function.(In 'this.Swipout.setNativeProps({ close: true })', 'this.Swipeout.setNativeProps' is undefined)

I just want to know that Will setNativeProps works for external libraries as well? if not is there any way to access the props of external libraries?

Thank You.