react-screen-capture
react-screen-capture copied to clipboard
Return `void` instead of `null`
Hey, I just installed this library.
First thing I noticed, I get type mismatch when I create a handler like this:
const handleStartCapture = () => {};
Turns out the interface for ScreenCapture props is this?:
interface Props {
onStartCapture: () => null;
onEndCapture: (url: string) => null;
}
I suggest changing return type of null
to void
, otherwise we are forced to return a value even if we don't want to.
Additionally, the example in Readme and in npm page does not present onStartCapture
as required attribute, so it would be nice to update the example.