Closed yoriiis closed 3 years ago
According to the JSX documentation and the README of the project, an attribute with the false value should be ignored.
false
Note that false, true, null, undefined will be ignored per React documentations, and everything else will be used.
Since the v7.0.4, the value of the boolean is rendered even if the value is false. The change was introduced by the following commit https://github.com/proteriax/jsx-dom/commit/10cb737020fc7bc7d3507f760e9e3821faef583.
v7.0.4
Example:
<a href="" target={false}></a> <a href="" target={false && '_blank'}></a> <a href="" data-target={false}></a> <a href="" data-target={false && '_blank'}></a>
Is rendered as:
<a href="" target="false"></a> /* incorrect */ <a href="" target="false"></a> /* incorrect */ <a href=""></a> /* correct */ <a href=""></a> /* correct */
It seems data-* attribute are ignored but not the target attribute.
data-*
target
Is it a mistake?
You’re right. This is a bug.
Published 8.0.0-beta.0 to revert to the old boolean behavior.
8.0.0-beta.0
According to the JSX documentation and the README of the project, an attribute with the
false
value should be ignored.Since the
v7.0.4
, the value of the boolean is rendered even if the value isfalse
. The change was introduced by the following commit https://github.com/proteriax/jsx-dom/commit/10cb737020fc7bc7d3507f760e9e3821faef583.Example:
Is rendered as:
It seems
data-*
attribute are ignored but not thetarget
attribute.Is it a mistake?