Cannot read "props" of undefined (formless field)
See original GitHub issueEnvironment
- react-advanaced-form: 1.6.4
What
Current behavior
When rendering a field without a parent Form
, it will throw the mentioned exception in the console.
Expected behavior
Ideally, #216, yet for now need to add a better explanation of what the error is about.
- Whenever a field is created without a
Form
passed to it through the context, a meaningful error must be displayed in the console - The rendering of the page must not be blocked; formless field returns
null
from itsrender
method.
Why
Need to have good DX, errors must be transparent.
How
- Check
this.context.form
uponField
mount. - If
undefined
, throw a verbose error, prevent from attempting to register.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
React TypeError: Cannot read property 'props' of undefined
The "Cannot read property 'props' of undefined" error occurs when a class method is called without having the correct context bound to the...
Read more >React - TypeError: Cannot read property 'props' of undefined
I'm trying to create a click event be able to delete an item on my list, but when I click it I get...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >Bug: Cannot read property 'active' of undefined #186 - GitHub
I am trying to use a slider component in my form and a conditional field which is based on the field which is...
Read more >TypeError: Cannot read property 'props' of undefined (Example)
TypeError : Cannot read property 'props' of undefined ... According to the compiler, props does not exist. However, through the Player SFC, ...
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
Sure, let me confirm the same if it works then we cam move to other issues after closing it.
No worries. Glad it cleared it out for you.
There is a React Advanced Form Discord channel for communication. You are welcome to stop by.