jsx-boolean-value: don't warn if the value attribute of an <option> tag
See original GitHub issueIn my opinion the plugin should not warn when the JSX is something like <option value={ true }>True</option>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
don't warn if the value attribute of an <option> tag ... - GitHub
In my opinion the plugin should not warn when the JSX is something like True.
Read more >Using boolean-value of attributes in JSX - Stack Overflow
This approach avoids the warning Value must be omitted for boolean attributes [react/jsx-boolean-value] when the code is linted via ...
Read more >Select - Ant Design
Select component to select value from options. When To Use. A dropdown menu for displaying choices - an elegant alternative to the native...
Read more >styled-jsx - npm
The plugin accepts a type option to configure whether the styles should be scoped , global or resolve (see above). By default its...
Read more >DOM Elements - React
In React, all DOM properties and attributes (including event handlers) should ... If you want to mark an <option> as selected, reference the...
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 Free
Top 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
Why?
<option value>
is equivalent and more concise.<option value={true} />
should be outputting the same thing. In other words, if you want the syntaxes to match you should do<option value={String(true)} />
instead of relying on React to coerce for you.I don’t think an option to allow this case is a good idea.