undefined is not an object(evaluating 'container.setState')
See original GitHub issueHai, I run your demo project,and check in device it working fine, But in index.ios.js, i added the some code for navigator, added some form code init.when click on signIn button i want to show the webRtc screen for that screen i just copied the main.js file code in RTcWebdemo project and added in my code, here is my code index.ios.js
if (!window.navigator.userAgent) {
window.navigator.userAgent = "react-native";
}
'use strict';
import React,{Component} from 'react';
var SignIn = require('./SignIn');
import {
AppRegistry,
StyleSheet,
Navigator,
AsyncStorage,
} from 'react-native';
class RCTWebRTCDemo extends Component {
render() {
return (
<Navigator
initialRoute={{
component:SignIn //component declaration
}}
configureScene={(route) => ({
...Navigator.SceneConfigs.HorizontalSwipeJump,
gestures: false
})}
renderScene={(route, navigator) =>{
return <route.component navigator={navigator} {...route.passProps} />;
}}/>
);
}
};
signIn.js
onSignin(){
this.props.navigator.push({
component: main
})
}
When click on signIn button of the below image calling the above function in main component i added the main.js file code
but when i run project before clicking on signIn button, It shows some error like this
please give me suggestions that how to resolve this
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
TypeError: undefined is not an object (evaluating 'this.setState')
This is because you have declared login as a function and it get executed before the component gets mounted which means there is...
Read more >React Native Community | undefined is not object (evaluating ...
undefined is not object (evaluating 'container.setState') i am using webrtc .The code which i am using is from this link...
Read more >typeerror: undefined is not an object (evaluating 'state.card.item')
You are using this.setState inside a functional component. You cannot mix those two together (you can only use it inside a class component)....
Read more >TypeError: null is not an object (evaluating 'WebRTCModule ...
TypeError: null is not an object (evaluating 'WebRTCModule. ... target element 'video-container' }; // Init a publisher passing undefined as ...
Read more >React - How to fix this.setState is not a function error
This tutorial will show you how to use both ways to fix your error. You may have a React class component similar to...
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
make sure you set
container = this
in the mainWebRTCDEMO Component
’sComponentDidMount
.my suggestion would be: try to understand demo
main.js
logic, and applied it in to your own logic.Nothing actionable for the plugin itself, closing.