mozmorris / react-webcam

Webcam component
https://codepen.io/mozmorris/pen/JLZdoP
MIT License
1.65k stars 281 forks source link

Using render props to simplify image capture #322

Closed lucassaid closed 2 years ago

lucassaid commented 2 years ago

Using this approach we can get rid of useRef and useCallback when getting the screenshot

mozmorris commented 2 years ago

Hey @lucassaid - this is great, thank you. Will give it a spin and then look to merge it.

Apexal commented 2 years ago

Any update on this? @mozmorris

mozmorris commented 2 years ago

Sorry for the delay. I did test this and forgot to leave a note. This requires bumping the minimum React version to 16, which I think is legitimate now that 18 is in RC status. I'll create a major release with this in.

mozmorris commented 2 years ago

@Apexal @lucassaid I've published this under 7.0.0, currently as the next tag. Any chance you could test it? npm install react-webcam@next

I've tested here locally with a couple of apps we use, everything looks good.

Apexal commented 2 years ago

I'm able to successfully use it in a TypeScript project!

mozmorris commented 2 years ago

Yup, same. I'll assign it to the latest tag so it's the default. Thanks for testing @Apexal. And many thanks again @lucassaid.