question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React 16 Warning: Received `true` for non-boolean attribute `unselectable`.

See original GitHub issue

Version

2.13.4

Environment

browser

Reproduction link

https://ant.design

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:closed
  • Created 6 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

24reactions
afc163commented, Oct 2, 2017
22reactions
shahzeb1commented, Jan 24, 2018

I’m still getting the same error but with <Checkbox />.

Is there a fix for this?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found