-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'bind' of undefined / undefined is not an object evaluating _this._setComponentRef.bind #22157
Comments
My initial error is with the js debugging active, without the debugger the error is : undefined is not an object evaluating _this._setComponentRef.bind which is found in more react-native issues : Nothing from the solutions worked for me. |
I have the same problem and I have resolved it rebooting my computer and adding this babel plugin: @babel/plugin-transform-flow-strip-types But I am sure that is a cache issue, because since RN 57.4 sometimes my iOS simulator cannot update changes done to the source code like if the metro/watchman can't detect those changes.... |
I get the same but use typescript! I'll try with the @babel/plugin-transform-flow-strip-types plugin ... feels a bit strange |
Getting someowhat the same error. babel.config.js: module.exports = {
presets: ["babel-preset-expo"],
plugins: [
["@babel/plugin-transform-flow-strip-types"],
[
"@babel/plugin-proposal-class-properties",
{
loose: true
}
]
]
}; I'm using expo with typescript tsconfig.json {
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"jsx": "react-native",
"lib": ["dom", "es2015", "es2016", "es2017"],
"module": "es2015",
"moduleResolution": "node",
"noEmitHelpers": true,
"noImplicitReturns": true,
"noImplicitAny": false,
"noUnusedLocals": true,
"skipLibCheck": true, // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24573
"sourceMap": false,
"strict": true,
"target": "es2017"
},
"exclude": ["node_modules"],
"types": ["typePatches"]
} |
I have the exact same problem with new react native project and a touchable opacity component on windows 10. |
Workaround by removing the following plugins from .babelrc: The plugins were used by mobx decorators, now converted to a no-decorator style. |
Hello there 👋 this issue seems to have been inactive for the past few months. Because of this, it's likely that the issue has been solved; for this reason, we'll close it. But please, if it's actually still an issue with 0.59 please comment below and we can reopen it or please send us a Pull Request with a fix 😊 Also, this is most likely related to metro, so probably it would be better to open a dedicated issue in its repo. |
if they write " this.nameFunction = this.nameFunction.bind(this) " being these same arrow functions, this error occurs. this is given that if we define a function as an arrow, it is included in the environment |
Environment
React Native Environment Info:
Description
With the latest react-native cli (2.0.1) when using TouchableOpacity, the app crash and throws an error:
TypeError: Cannot read property 'bind' of undefined
This error is located at:
in AnimatedComponent (at TouchableOpacity.js:256)
Reproducible Demo
Using react-native init, I have added only a simple TouchableOpacity inside the code :
The text was updated successfully, but these errors were encountered: