score:1
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..});
}
Source: stackoverflow.com
Related Query
- React - uncaught TypeError: Cannot read property 'setState' of undefined
- Line 0: Parsing error: Cannot read property 'map' of undefined
- react router v^4.0.0 Uncaught TypeError: Cannot read property 'location' of undefined
- Error : Cannot read property 'map' of undefined
- React with ES7: Uncaught TypeError: Cannot read property 'state' of undefined
- Uncaught TypeError: Cannot read property 'push' of undefined (React-Router-Dom)
- React enzyme testing, Cannot read property 'have' of undefined
- Cannot read property 'history' of undefined (useHistory hook of React Router 5)
- React - TypeError: Cannot read property 'props' of undefined
- React-Router - Uncaught TypeError: Cannot read property 'getCurrentLocation' of undefined
- Redux TypeError: Cannot read property 'apply' of undefined
- React Router: Cannot read property 'pathname' of undefined
- React Typescript: Line 0: Parsing error: Cannot read property 'name' of undefined
- reactjs Cannot read property 'keys' of undefined
- TypeError: Cannot read property 'contextTypes' of undefined
- TypeError when using React: Cannot read property 'firstChild' of undefined
- TypeError: Cannot read property 'prepareStyles' of undefined
- Cannot read property '.then' of undefined when testing async action creators with redux and react
- Cannot read property ‘params’ of undefined (React Router 4)
- Cannot read property 'string' of undefined | React.PropTypes | LayoutPropTypes.js
- React Tutorial: TypeError: Cannot read property 'props' of undefined
- Node error Cannot read property 'resolve' of undefined
- TypeError: Cannot read property 'equal' of undefined
- TypeError: Cannot read property 'javascript' of undefined + terser webpack plugin + react js
- react-router v5.1.0 Cannot read property 'location' of undefined ,
- Tailwind V3 causing TypeError: Cannot read property '500' of undefined
- React Material-UI Modal TypeError: Cannot read property 'hasOwnProperty' of undefined
- Axios ReactJS - Cannot read property 'setState' of undefined
- Uncaught TypeError: Cannot read property 'call' of undefined at __webpack_require__
- draft-js Cannot read property 'getIn' of undefined ( getUpdatedSelectionState )
More Query from same tag
- MapDispatchToProps doesn't work on returning an object
- Rechartd: Vertical bar chart - set bar thickness
- Concatenate data from multiple fetch JS (RAWG API)
- How to delete chips in Material UI
- Laravel Sanctum SPA catch() at the end of a promise chain won't catch error
- D3 how to curve segments when using `line.defined()`
- match.params.id works in react-router-dom version5 but not in version 6
- useMutation reload data after refetch
- how to use if else condition in jsx?
- How to prevent re-rendering the component which is inside router, when the state of super component changes?
- How to console.log() this function?
- How to get local storage value when component Did mount?
- How do you set multiple values in an objects state with useReducer?
- React formatting issue
- not assignable to type 'IntrinsicAttributes & ContentOutlineProps & ContentBrainstormProps' for dynamically rendered component
- Material UI Carousel autoplay and loading image issue
- reactJS componentWillMount is run after render method
- Is there a problem in 'react-metismenu-router-link' with react16?
- Load more data on scroll
- How do I use history prop with other props
- How to install dhtmlx
- How to send parameters through axios get method in react?
- How to navigate on a page without reloading the page
- Placeholder for images before they are loaded
- What does jest.fn() do and how can I use it?
- Three option for displaying dynamical javascript with css
- How to apply margin to a div on condition using styled component and react?
- React. Change pictures onclick
- JS reduce list based on one of its properties
- Child route is loaded but not rendered