rajinwonderland / react-code-blocks

React code blocks and code snippet components
https://react-code-blocks.rajinwonderland.vercel.app
MIT License
611 stars 82 forks source link

CopyBlock warnings #104

Open fabpico opened 1 year ago

fabpico commented 1 year ago

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
... 
thomasmost commented 1 year ago

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

kxtran commented 9 months ago

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

svjaime commented 9 months ago

Any update on this?

fabpico commented 8 months ago

@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?

kleysonfiretail commented 3 months ago

Any update on this?