React 16 Warning: Received `true` for non-boolean attribute `unselectable`.
See original GitHub issueVersion
2.13.4
Environment
browser
Reproduction link
Steps to reproduce
Upgrade to React 16 and use a TreeSelect with this properties:
const tProps = {
multiple: true,
treeData,
treeCheckable: true,
showCheckedStrategy: SHOW_PARENT,
searchPlaceholder: "Select one or more Categories",
filterTreeNode: filterCategories,
allowClear: true
};
return (
<TreeSelect
className="search-panel-element"
{...tProps}
value={selectedCategories}
onChange={onSelectCategory}
getPopupContainer={triggerNode => triggerNode.parentNode}
/>
);
What is expected?
no warnings
What is actually happening?
receiving warnings:
Warning: Received `true` for non-boolean attribute `unselectable`. If this is expected, cast the value to a string.
in ul (created by Tree)
in Tree (created by SelectTrigger)
in div (created by SelectTrigger)
in LazyRenderBox (created by PopupInner)
in div (created by PopupInner)
in PopupInner (created by Popup)
in Align (created by Popup)
in AnimateChild (created by Animate)
in Animate (created by Popup)
in div (created by Popup)
in Popup
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Warning: Received `false` for a non-boolean attribute. How do ...
How do I pass a boolean in a custom attribute for React? I'm using styled-components and passing the attribute through the component. Here...
Read more >Warning: Received true for non-boolean attribute gray . #1198
How can I resolve this warning? Warning: Received `true` for non-boolean attribute `gray`. If this is expected, cast the value to a string....
Read more >How to fix the 'Received "true" for a non-boolean attribute' error
The trick is to use the unary plus operator to convert boolean to number. before your booleans values. According to MDN unary operator...
Read more >How to Fix ' Received false for non-boolean attribute' Errors
The "Warning: Received false for a non-boolean attribute className." warning happens in React when you try to conditionally set a attribute, ...
Read more >warning: received `false` for a non-boolean attribute react
warning received true for a non-boolean attribute jsx. If you get this warning it means that your styles were not compiled by styled-jsx....
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
Fixed in https://github.com/react-component/tree/pull/131
I’m still getting the same error but with
<Checkbox />
.Is there a fix for this?