Skip to content

Commit

Permalink
Fix reading Component.__N_SSG (#10037)
Browse files Browse the repository at this point in the history
* Fix error when reading Component.__NEXT_SPR in packages/next/client/index.js

* Use the .? optional chaining operator

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update index.js

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <timer150@gmail.com>
  • Loading branch information
3 people committed Jan 14, 2020
1 parent d9d9545 commit ce2714d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/client/index.js
Expand Up @@ -94,7 +94,7 @@ class Container extends React.Component {
if (
(data.nextExport &&
(isDynamicRoute(router.pathname) || location.search)) ||
(Component.__N_SSG && location.search)
(Component && Component.__N_SSG && location.search)
) {
// update query on mount for exported pages
router.replace(
Expand Down

0 comments on commit ce2714d

Please sign in to comment.