You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move conditional useInsertionEffect declarations into separate package (#2867)
* Move conditional `useInsertionEffect` declarations into separate package
* add missing dependecies
* regenerate lockfile
* Add missing peer dep
* regenerate lockfile
* add missing dev dep for a peer dep
* regenerate lockfile
* add changesets
Externalized code referencing `React.useInsertionEffect` to a separate `@emotion/use-insertion-effect-with-fallbacks` package. This package should be used in your defined externals if you bundle Emotion for whatever reason. It references `useInsertionEffect` in a very specific way that allows us to use it conditionally. However, if the code consuming Emotion is bundled as a library with Emotion in it then some bundlers might change the way in which we reference `useInsertionEffect` and that might create problems for bundlers used to consume the said library code. By externalizing this new package you can still bundle Emotion if you want to without running into this problem as you won't "destroy" the carefully crafted reference to `useInsertionEffect` in the process.
7
+
8
+
Note that we don't recommend bundling Emotion. You should have very specific reasons to do so.
'@emotion/use-insertion-effect-with-fallbacks': major
3
+
---
4
+
5
+
A wrapper package that uses `useInsertionEffect` or a specific fallback for it. It comes with two exports: `useInsertionEffectAlwaysWithSyncFallback` and `useInsertionEffectWithLayoutFallback`.
constILLEGAL_ESCAPE_SEQUENCE_ERROR=`You have illegal escape sequence in your template literal, most likely inside content's property value.
21
21
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
0 commit comments