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.

Cannot read property 'keepState' of undefined

See original GitHub issue

It seems like with the 2V you added a new property called ‘keepState’.

When I unmount a component that uses the Form component I get the following error message.

Uncaught TypeError: Cannot read property ‘keepState’ of undefined at FormController.deregister (index.js?5725:4461) at eval (index.js?5725:5038)

Here my code.

// PARENT COMPONENT
toogleForm = () => {
    this.setState((prevState) => ({
      form_open: !prevState.form_open
    }))
  }

render(){
  return {this.state.form_open && <EstimateForm/> }
}


// COMPONENT THAT USES FORM

const EstimateForm = (props) => {
  return (
    <Form
      className='Modal_form'
    >
      <Text field='code' />

      <div className="Modal_form_section">
        <button className="Modal_form_submit" type="submit">
          Guardar
        </button>
      </div>
      
  </Form>
  )
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
joepuzzocommented, Feb 14, 2019

In other words if you opened the source code for informeds Text you would see that its wrapped in asField. The BasicText is not! therefore what your code is doing is creating two fields with the same name causing informed to freak out because it does this: 1. Deregister the field code 2. Deregister the field code… “AHHH THERE IS NO FIELD CODE” 😃

0reactions
joepuzzocommented, Nov 22, 2019

Create a code sandbox. Prob doing something similar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React with ES7: Uncaught TypeError: Cannot read property ...
I'm getting this error Uncaught TypeError: Cannot read property 'state' of undefined whenever I type anything in the input box of AuthorForm ...
Read more >
What is "TypeError: Cannot read property 'state' of undefined"?
The error message says that you don't have the state property on an undefined object. To decode this, we have to understand the...
Read more >
Cannot read property 'state' of undefined in ReactJS
When the variable is not defined, JavaScript can not read the undefined variable or property. A similar issue we can find in React...
Read more >
Cannot read property when passing in a prop-Reactjs
TypeError : Cannot read property 'name"' of undefined in react when passing object in useState · Got a little bit of a problem...
Read more >
TypeError: Cannot read property state of undefined - Michael S
It means that this.state is 'undefined', therefore I just put 'this.state' on console.log and check what comes out. 2. console.log(this.state)
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