Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 20c7d98

Browse files
timneutkensnkzawa
authored andcommitted
Move lastAppProps back where it should be (vercel#1208)
* Check for lastAppProps * Move lastAppProps back where it belongs * Add comment
1 parent 310f430 commit 20c7d98

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

client/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ async function doRender ({ Component, props, err, emitter }) {
7777
props = props || lastAppProps.props
7878

7979
const appProps = { Component, props, err, router, headManager }
80+
// lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error.
81+
lastAppProps = appProps
82+
8083
ReactDOM.render(createElement(App, appProps), container)
8184

8285
if (emitter) {
8386
emitter.emit('after-reactdom-render', { Component })
8487
}
85-
86-
lastAppProps = appProps
8788
}

0 commit comments

Comments
 (0)