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

Return void instead of null #7

Open
kkosmowski opened this issue Mar 25, 2022 · 0 comments
Open

Return void instead of null #7

kkosmowski opened this issue Mar 25, 2022 · 0 comments

Comments

@kkosmowski
Copy link

kkosmowski commented Mar 25, 2022

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.

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

1 participant