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

Added impl Default for Callback #962

Closed
wants to merge 2 commits into from

Conversation

jfbilodeau
Copy link

Greetings,

I've added impl Default for Callback to make it easier to provide optional callback from component properties.

@jstarry
Copy link
Member

jstarry commented Feb 25, 2020

Thanks @jfbilodeau!

We actually intentionally don't implement Default for Callback because it could cause unexpected behavior (devs might not realize they forgot to pass an optional callback to a component for example). I think the issue you are having will be resolved with the new Properties 2.0 proposal here: #928 It will make optional callbacks more explicit.

Feel free to weigh in!

@jfbilodeau
Copy link
Author

Agreed. Props 2.0 is a much nicer solution. Thanks!

@jstarry jstarry closed this Feb 26, 2020
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

Successfully merging this pull request may close these issues.

2 participants