Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StrictMode warnings because of renderElement #42

Open
kachkaev opened this issue Feb 21, 2020 · 3 comments
Open

StrictMode warnings because of renderElement #42

kachkaev opened this issue Feb 21, 2020 · 3 comments

Comments

@kachkaev
Copy link

👋 @kciter,

Awesome lib, I've been using it for a couple of years!

You've probably heard about the upcoming Concurrent Mode, which imposes some additional restrictions to the components. It seems that react-barcode is not fully compatible because of a string ref begin used. Here is a warning I'm seeing after wrapping <Barcode> into <React.StrictMode>:

Warning: A string ref, "renderElement", has been found within a strict mode tree.
String refs are a source of potential bugs and should be avoided. We recommend
using useRef() or createRef() instead. Learn more about using refs safely here:
https://fb.me/react-strict-mode-string-ref
@iamchathu
Copy link

Same here. I'm getting this on a Next.js project. Warning seems pushed from SSR.

@iamchathu
Copy link

I created a simple hooks based one without this warning react-jsbarcode

@robert8888
Copy link

Why you don't publish this changes ? there is pr merged to master month ago and in 1.4.1 i still get this strict mode message....
When are you planning to do this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants