score:1

Accepted answer

i can not add a comment. did you import panresponder like this : var reactnative = require('react-native'); var { panresponder, } = reactnative;

or es6: import { panresponder } from 'react-native';

score:1

i found that {...this._panresponder.panhandlers} was throwing error when panresponder functions were defined in componentdidmount() function.

it worked fine when componentwillmount() is used in place of componentdidmount(). but since componentwillmount() has been deprecated, i found that defining panhandler functions inside constructor solved the issue.

so try defining your functions like this

constructor(props) {
        super(props);
        this.state = {
            yourvariables: false
        };

        this._panresponder = panresponder.create({ ..your logic here..});
}

Related Query

More Query from same tag