I had the installation of the ViewPager component in my react-native application that looks something like this:
render(){ return( <View> <ViewPager ref="main" dataSource={this.state.dataSource} renderPage={this.renderView} /> <TouchableHighlight onPress={this._onPressButton}> <Text>Something</Text> </TouchableHighlight> </View> ); } renderView(){ return( <View ref="main1"> <Text>Something else</Text> </View> ); } _onPressButton(){ //Do something with {this.refs.main} and {this.refs.main1} }
In the _onPressButton function _onPressButton I can access the ViewPager component using this.refs.main , but this.refs.main1 returns null . But I want to get a link to this view with a link to main1 . How can i do this?
source share