forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pages react alias (vercel#50128)
Fix react and react-dom aliases are not properly set for `pages/` * Remove alias react-dom internals to `{}` in edge runtime as we're using server rendering stub as alias * Add `react$`, `react-dom$` missing aliases * Only apply alias to builtin react/react-dom when it's app dir assets. * Add `react|react-dom/package.json` resolving to require-hook * Fix hmr issue that sometimes it will perform a reload when a hard navigation is triggered
- Loading branch information
Showing
8 changed files
with
220 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import ReactDOMServer from 'react-dom/server.browser' | ||
|
||
export default function Page() { | ||
return <div>{'version=' + React.version}</div> | ||
return ( | ||
<div> | ||
<p id="react">{'React.version=' + React.version}</p> | ||
<p id="react-dom">{'ReactDOM.version=' + ReactDOM.version}</p> | ||
<p id="react-dom-server"> | ||
{'ReactDOMServer.version=' + ReactDOMServer.version} | ||
</p> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import ReactDOMServer from 'react-dom/server' | ||
|
||
export default function Page() { | ||
return ( | ||
<div> | ||
<p id="react">{'React.version=' + React.version}</p> | ||
<p id="react-dom">{'ReactDOM.version=' + ReactDOM.version}</p> | ||
<p id="react-dom-server"> | ||
{'ReactDOMServer.version=' + ReactDOMServer.version} | ||
</p> | ||
</div> | ||
) | ||
} | ||
|
||
export const runtime = 'experimental-edge' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import ReactDOMServer from 'react-dom/server' | ||
|
||
export default function Page() { | ||
return <div>{'version=' + React.version}</div> | ||
return ( | ||
<div> | ||
<p id="react">{'React.version=' + React.version}</p> | ||
<p id="react-dom">{'ReactDOM.version=' + ReactDOM.version}</p> | ||
<p id="react-dom-server"> | ||
{'ReactDOMServer.version=' + ReactDOMServer.version} | ||
</p> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.