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

Export the EmotionCacheContext #2418

Closed

Conversation

sarayourfriend
Copy link
Contributor

@sarayourfriend sarayourfriend commented Jul 2, 2021

What: Just exporting the EmotionCacheContext.

Why: So that Emotion users can more easily hook into it to build their own APIs without having to use create-emotion. For example this issue could be resolved without an upstream change because the useCx hook wouldn't need to rely on the internal _context property on the Provider (which is undocumented).

How: Just a two line change to export the cache context.

Checklist:

  • Documentation N/A
  • Tests N/A
  • Code complete
  • Changeset

Alternatives to this are:

  1. Exporting useEmotionCacheContext instead of the context itself

Not sure if there are other alternatives other than adding useCx upstream but I'm not sure if that's desired at this point. This is a stop-gap in case it's not viable to add directly into Emotion for whatever reason.

@changeset-bot
Copy link

changeset-bot bot commented Jul 2, 2021

🦋 Changeset detected

Latest commit: f25be59

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@emotion/react Patch

Not sure what this means? Click here to learn what changesets are.

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 2, 2021

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 f25be59:

Sandbox Source
Emotion Configuration

@Andarist
Copy link
Member

Andarist commented Aug 8, 2021

This sort-of got implemented in #2441

@Andarist Andarist closed this Aug 8, 2021
@sarayourfriend sarayourfriend deleted the add/export-emotion-cache branch August 8, 2021 15:18
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