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

CopyBlock warnings

Open fabpico opened this issue 1 year ago • 5 comments

React 18.2.0 Storybook 7.3.1 react-code-blocks 0.1.3

I have this simple implementation

import {CopyBlock, a11yLight} from "react-code-blocks";

<CopyBlock
    language='javascript'
    text={'foo'}
    theme={a11yLight}
/>

The component works, but I get warnings

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()}.

If you used to conditionally omit it with copied={condition && value}, pass copied={condition ? value : undefined} instead.
    at button
 ...
Warning: 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.
    at div
... 

fabpico avatar Aug 18 '23 09:08 fabpico

Thanks for reporting this — I'll look when I have some time!

thomasmost avatar Aug 18 '23 14:08 thomasmost

Duplicated of https://github.com/rajinwonderland/react-code-blocks/issues/138

kxtran avatar Jan 04 '24 20:01 kxtran

Any update on this?

svjaime avatar Jan 12 '24 14:01 svjaime

@thomasmost I would gladly fix it, but I'm currently having problems installing the project. Can a current contributor maybe do the project's todo point Contributor guide for development, so that I can better give a hand?

fabpico avatar Feb 12 '24 10:02 fabpico

Any update on this?

kleysonfiretail avatar Jul 15 '24 10:07 kleysonfiretail