react-code-blocks icon indicating copy to clipboard operation
react-code-blocks copied to clipboard

CopyBlock: Errors in the Console because of copied/codeBlock

Open Fae-Bell opened this issue 1 year ago • 2 comments

I'm seeing two warnings and errors in the console in the UI when using CopyBlock. They say:

React does not recognize the codeBlock prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase codeblock instead. If you accidentally passed it from a parent component, remove it from the DOM element.

and

Warning: Received false for a non-boolean attribute copied. If you want to write it to the DOM, pass a string instead: copied="false" or copied={value.toString()}.

Looking at the demo sandbox, this looks to have been introduced in 0.1.3: https://codesandbox.io/s/react-code-blocks-forked-lqwfkr

Fae-Bell avatar Nov 17 '23 23:11 Fae-Bell

This library does a terrific job rendering code. Thanks to @rajinwonderland for releasing this.

It would be fantastic if these warnings are addressed. There's a risk that it will break functionality in the future. Plus the noise in console makes it harder to see other issues.

peacechen avatar Dec 06 '23 06:12 peacechen

any update on this? In nextJS, it breaks making the site unusable.

amosmachora avatar Feb 10 '24 06:02 amosmachora