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
Mixing both default and named exports has no clearly defined behaviour
and can easily lead to unexpected results. Some tools use a combination of
"default" + "__esModule" property and others ignore named exports
completely if both are found. Those issues are difficult to debug when multiple tools are
used together.
This change makes some code redundant by not having to patch a hand crafted exports
object for commonjs environments.
The only breaking change introduced with the `6.x` is that the `default` exports have been removed in favor of named exports. To update, replace the default import in your code with a named one.
100
+
101
+
```diff
102
+
- import render from 'preact-render-to-string';
103
+
+ import { render } from 'preact-render-to-string';
104
+
```
105
+
106
+
Similarily if you've been using the `jsx` renderer, the default import needs to be swapped with a named import:
107
+
108
+
```diff
109
+
- import render from 'preact-render-to-string/jsx';
110
+
+ import { render } from 'preact-render-to-string/jsx';
111
+
```
112
+
113
+
_Note: The named exports were already present in the `5.x` release line. So if you can't update today for any reason, you can apply the above changes safely to make a future update to `6.x` easier!_
0 commit comments