purple-technology / react-camera-pro

Mobile first camera component for React.
MIT License
182 stars 89 forks source link

warnings with mirrored and aspectRatio #48

Open benjamin-benoit opened 1 year ago

benjamin-benoit commented 1 year ago

Hello, I have two warnings with the lib, it's errors that we wan only fix in the lib:

Warning: Received `false` for a non-boolean attribute `mirrored`.

If you want to write it to the DOM, pass a string instead: mirrored="false" or mirrored={value.toString()}.

If you used to conditionally omit it with mirrored={condition && value}, pass mirrored={condition ? value : undefined} instead.
react-dom.development.js:86 Warning: React does not recognize the `aspectRatio`$ prop on a DOM element.

If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `aspectratio` instead.

If you accidentally passed it from a parent component, remove it from the DOM element.
99power commented 1 week ago

This only happens on React 19 afaik. I recently upgraded to Nextjs15 and React19 when these warnings started to show up, before it worked fine.

99power commented 5 days ago

This PR should fix these issues.