React-native-gesture-handler: Warning: bind(): You are binding a component method...

Created on 24 Jan 2019  Â·  18Comments  Â·  Source: software-mansion/react-native-gesture-handler

image

Affected Version: 1.0.14

This line causing a warning.

Most helpful comment

Just import ScrollView from react-native and not react-native-gesture-handler

All 18 comments

Yep, can confirm 1.0.14 added this warning. It was not present in 1.0.12.

I bet it's related to RN 0.58, from their release notes:

Break changes to ScrollView, CameraRollView, and SwipeableRow that make it no longer bound to the component instance in certain methods

So 1.0.14 should have a peer dependency to RN ~0.58
I'll go for a 1.1.0, and make a 1.0.15 with a RN peer dep to <=0.57

I have this code without any 'bind' method but that warning appears :/

const CustomTable = props => ( <View {...props}> <View style={styles.sectionHeader}> <Text style={styles.headerTitle}>{props.titulo}</Text> </View> <Grid style={styles.grid}> <Col style={styles.col}> <Text style={styles.colText}>{props.tituloLeftColumn}</Text> </Col> <Col style={{ ...styles.col, borderRightWidth: 0 }}> <Text style={{ ...styles.colText, textAlign: 'right' }}>{props.tituloRightColumn}</Text> </Col> </Grid> <FlatList data={props.data} style={styles.flatList} renderItem={renderItemList} ListEmptyComponent={ <Text style={styles.textEmpty}>No hay registros</Text> } /> </View> );

Thanks, work on it! 😄

I spent a good 3 hours tracking this issue, it makes the debug logs completely unusable bc warning fires every couple seconds. Pasting the warning so it becomes searchable:

Warning: bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See ScrollView

PR is pending

Is it customary to close a bug report before there is a fix? I've been wrestling with this (and related expo/react-navigation/react-native-gesture-handler bugs) for the last couple of weeks--I was under the understanding that this had been fixed and was investigating version clashes or strangeness in my project setup. (AFAIK it's impossible to run Expo 32 with react-navigation 3, so that should probably not have been released yet).

I though it will be merged faster. Reopen

Amazing! Ship it!

I think, you need upgrade npm package 'cause it doesn't include this fix

hey @linus and @quarrant – I'll be publishing new version in a few days, still waiting for a bunch of other updates to land.

Using ScrollView (or other core components) from react-native core removes the warning for now. Waiting for the pr merge so that the original package can be used. :)

Just import ScrollView from react-native and not react-native-gesture-handler

@shubham6996 I can't really do that since I'm using ScrollView from other libraries which depend on this lib (e.g. react-navigation). I imagine others are too.

I'm waiting patiently for this fix to be released. :)

Still waiting, dont like putting another warning on the yellow box exceptions

Bumped!

This went out as a part of 1.1.0 release and since 1.1.0 requires RN 0.57.2+ I also cherry-picked the fix and released 1.0.17 with it.

Was this page helpful?
0 / 5 - 0 ratings