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

Fix Preference"s types #2971

Merged
merged 1 commit into from
Nov 5, 2019

Conversation

MichaelDeBoey
Copy link
Contributor

What kind of change does this PR introduce?

Updated the props of Preference and it"s child components and also refactored the child components to FunctionComponents.

Follow-up of #2861

What is the current behavior?

  • Preference"s child components are ClassComponents
  • Preference"s child components export their props separately so they can be used by Preference

What is the new behavior?

  • Preference"s child components are FunctionComponents
  • Preference"s child components don"t export their props separately and Preference derives the props of his child components by using the ComponentProps generic

Checklist

  • [N/A] Documentation
  • Testing
  • Ready to be merged
  • [N/A] Added myself to contributors table

@lbogdan
Copy link
Contributor

lbogdan commented Nov 3, 2019

Build for latest commit 1fbcdb1 is at https://pr2971.build.csb.dev/s/new.

Copy link
Member

@CompuIves CompuIves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, TIL about ComponentProps<>! This is really smart, thanks a lot for refactoring these components 👍 👍 .

@CompuIves CompuIves merged commit 01fe235 into codesandbox:master Nov 5, 2019
@MichaelDeBoey
Copy link
Contributor Author

Yeah it"s a really nice generic type to use.
I almost don"t export type separately anymore, but just defer them using ComponentProps

@MichaelDeBoey MichaelDeBoey deleted the fix-preferences-types branch November 5, 2019 09:29
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.

3 participants