react-barcode icon indicating copy to clipboard operation
react-barcode copied to clipboard

Error: Element ref was specified as a string

Open Method42 opened this issue 7 years ago • 1 comments

Hello, i try to do that : allCrowdSourced = crowdSource.map((id,index) => ({ "EAN": <Barcode value={id.ean} ref={id.ean + index} /> }));

and i get this error : " Uncaught (in promise) Error: Element ref was specified as a string (260337780) but no owner was set. This could happen for one of the following reasons:

  1. You may be adding a ref to a function component
  2. You may be adding a ref to a component that was not created inside a component's render method
  3. You have multiple copies of React loaded "

if someone can explain me what's wrong with the component. if i do not pass ref in Barcode i've got the same error.

Thx for help

Method42 avatar Dec 14 '18 11:12 Method42

have the same error, any updates on this?

d-spiridonov avatar Apr 08 '19 10:04 d-spiridonov