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

Add default render props #735

Merged
merged 1 commit into from
Sep 29, 2020
Merged

Add default render props #735

merged 1 commit into from
Sep 29, 2020

Conversation

onlined
Copy link
Collaborator

@onlined onlined commented Sep 27, 2020

Description

Moved the default implementation of rendering to default props,
reducing the branching. I couldn't change renderInput (custom
implementations get wrapped by a div, default one doesn't) and
renderMonth (default implementation depends on state) trivially,
so I left them out of this PR's scope.

Motivation and Context

  • Simplifies the code
  • Reduces branching

Checklist

[x] I have not included any built dist files (us maintainers do that prior to a new release)
[ ] I have added tests covering my changes
[x] All new and existing tests pass
[ ] My changes required the documentation to be updated
  [ ] I have updated the documentation accordingly
  [ ] I have updated the TypeScript 1.8 type definitions accordingly
  [ ] I have updated the TypeScript 2.0+ type definitions accordingly

Moved the default implementation of rendering to default props,
reducing the branching. I couldn't change `renderInput` (custom
implementations get wrapped by a `div`, default one doesn't) and
`renderMonth` (default implementation depends on state) trivially,
so I left them out of this PR's scope.
@onlined onlined requested a review from arqex September 27, 2020 23:24
@arqex
Copy link
Owner

arqex commented Sep 29, 2020

Neat! Great work

@arqex arqex merged commit c08071d into master Sep 29, 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.

None yet

2 participants