Skip to content

Commit

Permalink
Merge branch 'polyfill-fetch' of github.com:janicklas-ralph/next.js i…
Browse files Browse the repository at this point in the history
…nto polyfill-fetch
  • Loading branch information
janicklas-ralph committed Oct 28, 2019
2 parents 6c53959 + 3662480 commit 1ab61d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,9 @@ export default async function getBaseWebpackConfig(
'process.env.__NEXT_PRERENDER_INDICATOR': JSON.stringify(
config.devIndicators.autoPrerender
),
'process.env.__NEXT_STRICT_MODE': JSON.stringify(
config.reactStrictMode
),
...(isServer
? {
// Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)
Expand Down
14 changes: 11 additions & 3 deletions packages/next/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,19 @@ async function doRender ({ App, Component, props, err }) {
appProps
})

// We catch runtime errors using componentDidCatch which will trigger renderError
renderReactElement(
const elem = (
<AppContainer>
<App {...appProps} />
</AppContainer>,
</AppContainer>
)

// We catch runtime errors using componentDidCatch which will trigger renderError
renderReactElement(
process.env.__NEXT_STRICT_MODE ? (
<React.StrictMode>{elem}</React.StrictMode>
) : (
elem
),
appElement
)

Expand Down
1 change: 1 addition & 0 deletions packages/next/next-server/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const defaultConfig: { [key: string]: any } = {
},
serverRuntimeConfig: {},
publicRuntimeConfig: {},
reactStrictMode: false,
}

const experimentalWarning = execOnce(() => {
Expand Down

0 comments on commit 1ab61d6

Please sign in to comment.