"_this2.setState is not a function."
See original GitHub issueI’m a new for rect-native, but I even can’t run the example which is given. It get the error as title when it run the code:
this.setState({ avatarSource: source });
and when I add the invoker into my own project, it give another warning and doesn’t work properly:
Attempt to present <UIAlertController: 0x7ff8ad99e9d0> on <UIImagePickerController: 0x7ff8c49f2e00> whose view is not in the window hierarchy!
Is there some wrong with my environment?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
React - _this2.SetState is not a function - Stack Overflow
Try this: class SearchBar extends Component { constructor(props) { super(props); this.state = { term: '' }; this.setInputState = this.
Read more >React Error: "this.setstate is not a function" - How to Fix
"this.setstate is not a function" is a common error message that comes up in React. In this article, we'll learn how to fix...
Read more >[Solved]-React TypeError: "_this2.setState is not a function"?
Coding example for the question React TypeError: "_this2.setState is not a function"?-Reactjs.
Read more >this.setstate is not a function - Code Examples & Solutions For ...
Make sure you use arrow functions to correctly bind 'this' handlePageChange = (page) => { this.setState({ currentPage: page }); } This will give...
Read more >React - setState is not a function - debuggr.io
setState is not a function. TL;DR - If you are not in the mode for reading or you just want the bottom line,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
try use
() => {}
mean that you don’t have the react class context in your function
for exemple on the onPress you can do like :
To bind your react class context into your function