question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

undefined is not an object(evaluating 'container.setState')

See original GitHub issue

Hai, 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 simulator screen shot 31-aug-2016 3 09 28 pm1

but when i run project before clicking on signIn button, It shows some error like this error

please give me suggestions that how to resolve this

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zxcpoiucommented, Sep 10, 2016

make sure you set container = this in the main WebRTCDEMO Component’s ComponentDidMount.

my suggestion would be: try to understand demo main.js logic, and applied it in to your own logic.

0reactions
saghulcommented, Jun 15, 2017

Nothing actionable for the plugin itself, closing.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found