React-Native-ViewPager icon indicating copy to clipboard operation
React-Native-ViewPager copied to clipboard

Ref doesn't not callback

Open ZionChang opened this issue 8 years ago • 0 comments

Hi, thanks for the library. I have some trouble when I use ref like this.

According to Refs and the DOM

<View style = {styles.container}>
      <IndicatorViewPager
		style={{flex:1, flexDirection: 'column-reverse'}}
		pagerStyle = {{flex: 1}}
                indicator={this._renderTitleIndicator()}
      >
          <View>
                <Text ref = {ref => ref => console.log('ref is ', ref)}>page one</Text>
          </View>
          <View>
                <Text>page two</Text>
           </View>
        </IndicatorViewPager>
</View>

There is no log in console.

However, it works when I remove IndicatorViewPager like this

<View style = {styles.container}>
      <View>
            <Text ref = {ref => ref => console.log('ref is ', ref)}>page one</Text>
      </View>
      <View>
            <Text>page two</Text>
       </View>
</View>

So what should I do?

ZionChang avatar Aug 18 '17 01:08 ZionChang