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.

Warning: Received `false` for a non-boolean attribute `autoCorrect`.

See original GitHub issue

Description There are some React warnings in a test environment (jsdom with Jest) regarding autoCorrect and autoCapitalize attributes.

Recording image

Environment

  • Slate Version: 0.62.1-2021326135112
  • Operating System: macOS 11.3.1
  • TypeScript Version: 4.1.2

Context After digging a bit, it seems like the warning is thrown because of this line which assigns the boolean false to autoCorrect (whereas it expects a string) in case HAS_BEFORE_INPUT_SUPPORT is false, which is the case in a jsdom environment.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
craigdallimorecommented, May 6, 2021

The same applies to autoCapitalize, if I understand correctly. jest will also error on that:

Warning: Received `false` for a non-boolean attribute `autoCapitalize`.
      
      If you want to write it to the DOM, pass a string instead: autoCapitalize="false" or autoCapitalize={value.toString()}.
      
      If you used to conditionally omit it with autoCapitalize={condition && value}, pass autoCapitalize={condition ? value : undefined} instead.
1reaction
TheSpydercommented, Jun 1, 2021

It’s just been released as 0.65 (see #4273).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Received `false` for a non-boolean attribute. How do I pass ...
This error with styled-components appears to be due to styled() attempting to apply a boolean ...
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 >
How to fix the 'Received "true" for a non-boolean attribute' error
I'll present an alternative to this solution. The trick is to use the unary plus operator to convert boolean to number.
Read more >
React DOM element's attribute should not have a value ...
This rule was introduced in DeepScan 1.7.0-beta. See. DOM Attributes in React 16. React Warning: Received false for non-boolean attribute ...
Read more >
<input>: The Input (Form Input) element - HTML
(Not a Boolean attribute!) The autocomplete attribute takes as its value a space-separated string that describes what, if any, type of ...
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