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

Accept custom context in ThemeProvider #1650

Closed
wants to merge 1 commit into from

Conversation

Andarist
Copy link
Member

@Andarist Andarist commented Nov 24, 2019

It's a followup to #1577 - it probably indeed didn't make much sense, but I believe there is some benefit in accepting a custom context prop in ThemeProvider

If we are going to decide to merge this in then I'd like to wait for #1609 to land first, so I can add final TS types in here - based on the work from that other PR.

@Andarist Andarist requested a review from emmatown November 24, 2019 19:06
@changeset-bot
Copy link

changeset-bot bot commented Nov 24, 2019

💥 No Changeset

Latest commit: e8ecc3e

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e8ecc3e:

Sandbox Source
Emotion Configuration

@Andarist Andarist added this to the v11 milestone Nov 24, 2019
@Andarist
Copy link
Member Author

Andarist commented Dec 2, 2019

@mitchellhamilton could u take a look at this one?

@emmatown
Copy link
Member

emmatown commented Dec 2, 2019

I'm not really big on this given how easy it is to implement yourself and it makes explaining the API harder(and I imagine it would be harder to type correctly)

@Andarist
Copy link
Member Author

Andarist commented Dec 7, 2019

My main motivation for this is to make it easier to use custom themes, the existing merging behavior of nested providers is good & quite intuitive - I won't insist at getting this merged right now as it can always be added later but is something that I thought was worth presenting as a PR. While this is easy to implement if one wants to have the same logic as builtin ThemeProvider for a custom theme they need to replicate it closely, won't even be able to copy-paste the builtin implementation as it requires subtle tweaks to support a custom theme.

Explaining this would be a separate section in the docs so I don't feel like this would make it particularly harder to understand and as to the types - I think it's possible to support this with TS conditional types.

Feel free to close this PR or comment back to get this a green light, both work for me.

@Andarist
Copy link
Member Author

@mitchellhamilton should I close this?

@emmatown emmatown closed this Dec 15, 2019
@Andarist Andarist deleted the theme-provider-custom-ctx branch November 10, 2020 23:00
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