Skip to content

Commit

Permalink
Merge branch 'main' into feat/runtime-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
caohuilin authored Jul 31, 2024
2 parents 334aa99 + db43d8e commit 10c20fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/tasty-ads-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/runtime': patch
---

fix: react 17 ssr context error

fix: 修复 react 17 ssr 找不到 runtimeReactContext 报错
5 changes: 4 additions & 1 deletion packages/runtime/plugin-runtime/src/core/browser/hydrate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ export function hydrateRoot(
});
} else {
loadableReady(() => {
ModernHydrate(App, callback).then(root => {
ModernHydrate(
React.cloneElement(App, { _internal_context: hydrateContext }),
callback,
).then(root => {
resolve(root);
});
});
Expand Down

0 comments on commit 10c20fa

Please sign in to comment.