-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
TypeError: this.setState is not a function #82
Comments
Any solution for this issue? |
Is the code where you are calling this a functional component or a class component? Can you show us the code where you are calling |
I suspect your issue is related to PR #70 |
See the PR I just pushed: PR #83 It has instructions on how to download and use it. Hopefully we can get this pulled into master and published soon. |
Hello, |
make some changes in code like : const Orientation = () => {
} |
Is this a bug report, a feature request, or a question?
Bug
Is the bug reproducible in a production environment (not a debug one)?
Yes
Environment
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-responsive-screen": "^1.4.1",
Bug:
TypeError: this.setState is not a function. (In 'this.setState({orientation: screenWidth < screenHeight ? 'portrait' : 'landscape'})', 'this.setState' is undefined)
I was using class component but had to change it to functional component as per project requirement. Since I changed it to functional component, orientation change is not working and am getting this error. I have attached screenshot for reference to this. Need solution for this, as i have used this library many times in my project.
The text was updated successfully, but these errors were encountered: