You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, you get an error when react tries to update the DOM, and things aren't as expected. Early errors are much better, so in development React should give clear errors based on valid HTML structures.
For example, the select element has 1 valid child: option. The option element has 1 valid child: text node. Forms have one invalid deep child: form; and tables have a quite a few rules.
The suggested error format:
InvariantViolation: at FooComponent <select> may only have <option> children, but
encountered: option, option, select, option, option
Forms. The element:N means displayName:childIndexIfNotZero.
InvariantViolation at FooComponent: <form> may not have any deep <form> children.
Culprit is form > div > form
InvariantViolation at FooComponent: <form> may not have any deep <form> children.
Culprit is form -> div > div:3 > section:2 > BarComponent > div > form:1
Tables
InvariantViolation at FooComponent: <table> may only have <caption>, <thead>, <tfoot>,
and <tbody> children, but encountered thead, tr*100
InvariantViolation at FooComponent: <table> may only have one <thead> child, but
encountered thead, thead, tr*100
InvariantViolation at FooComponent: <table> may only have one <thead> child, but
encountered thead, thead, tr*100
The less frequently encountered situations can be pushed to a different release, but I think it's important to have. These are bad habits that people are used to, because they're allowed in most other situations.
These are examples of people who have run into this problem.
Currently, you get an error when react tries to update the DOM, and things aren't as expected. Early errors are much better, so in development React should give clear errors based on valid HTML structures.
For example, the select element has 1 valid child: option. The option element has 1 valid child: text node. Forms have one invalid deep child: form; and tables have a quite a few rules.
The suggested error format:
Forms. The element:N means displayName:childIndexIfNotZero.
Tables
The less frequently encountered situations can be pushed to a different release, but I think it's important to have. These are bad habits that people are used to, because they're allowed in most other situations.
These are examples of people who have run into this problem.
select/option
nested forms:
tables
The text was updated successfully, but these errors were encountered: