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

unconditionally use ThemeContext in EmotionElement #2424

Merged
merged 7 commits into from
Aug 8, 2021

Conversation

tills13
Copy link
Contributor

@tills13 tills13 commented Jul 9, 2021

Fixes: #2423

What: remove conditional use of ThemeContext for serializing styles.

Why: prevents a React error (warning) in the following code: https://codesandbox.io/s/emotion-issue-template-forked-ettgx?file=/src/index.js

Checklist:

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

@changeset-bot
Copy link

changeset-bot bot commented Jul 9, 2021

🦋 Changeset detected

Latest commit: ec4ed43

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 9, 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 bc832f2:

Sandbox Source
Emotion Configuration
Emotion issue template (forked) PR
Emotion issue template (forked) Issue #2423

@tills13
Copy link
Contributor Author

tills13 commented Jul 9, 2021

I figure this would be a major given it's a behaviour change that should be tested by dependents? LMK if you want me to change it to a minor or a patch.

@tills13 tills13 marked this pull request as ready for review July 9, 2021 03:40
@tills13
Copy link
Contributor Author

tills13 commented Jul 12, 2021

The tests are kind of boring and specific (I typically don't write tests for the behaviour, as opposed testing behaviour changes in different code paths), but they will prevent someone from accidentally reverting the behaviour or thinking they could optimize back to what it was before.

Are they fine or would you like to see something specific tested?

@Andarist
Copy link
Member

I figure this would be a major given it's a behaviour change that should be tested by dependents? LMK if you want me to change it to a minor or a patch.

At the end of the day, this allows more situations to be rendered without crashing and doesn't really impact any situations that were previously rendered OK. So I would just stick with classifying this as a patch bump (a bug fix)

@tills13 tills13 force-pushed the fix-context-hook-usage branch from e4b23f3 to bc832f2 Compare July 13, 2021 18:13
@tills13
Copy link
Contributor Author

tills13 commented Jul 16, 2021

@Andarist this is ready to go, I think.

@Andarist Andarist merged commit cd25b62 into emotion-js:main Aug 8, 2021
@github-actions github-actions bot mentioned this pull request Aug 8, 2021
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.

React has detected a change in the order of Hooks called by EmotionCssPropInternal
2 participants