Improve error message when not providing a value for JSX key (#12983)
* Improve error message when not providing a value for key * Update packages/babel-plugin-transform-react-jsx/src/create-plugin.js Show location of attribute instead of only the path Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com> * Change error message to be less aggressive * Throw error when runtime is "classic" Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
|
||||
var x = [<div key></div>];
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Please provide an explicit key value. Using \"key\" as a shorthand for \"key={true}\" is not allowed."
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
var x = [<div key></div>];
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Please provide an explicit key value. Using \"key\" as a shorthand for \"key={true}\" is not allowed."
|
||||
}
|
||||
Reference in New Issue
Block a user