Skip to content

Commit

Permalink
Merge branch 'canary' into feat/plugins-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer authored Apr 22, 2021
2 parents fcfba1b + cce82cd commit 208a278
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 20 deletions.
12 changes: 8 additions & 4 deletions test/integration/router-is-ready/pages/auto-export/[slug].js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { useRouter } from 'next/router'
import { useLayoutEffect } from 'react'

export default function Page(props) {
const router = useRouter()

if (typeof window !== 'undefined') {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
// eslint-disable-next-line react-hooks/rules-of-hooks
useLayoutEffect(() => {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
}, [router])
}

return (
Expand Down
12 changes: 8 additions & 4 deletions test/integration/router-is-ready/pages/auto-export/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { useRouter } from 'next/router'
import { useLayoutEffect } from 'react'

export default function Page(props) {
const router = useRouter()

if (typeof window !== 'undefined') {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
// eslint-disable-next-line react-hooks/rules-of-hooks
useLayoutEffect(() => {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
}, [router])
}

return (
Expand Down
12 changes: 8 additions & 4 deletions test/integration/router-is-ready/pages/gip.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { useRouter } from 'next/router'
import { useLayoutEffect } from 'react'

export default function Page(props) {
const router = useRouter()

if (typeof window !== 'undefined') {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
// eslint-disable-next-line react-hooks/rules-of-hooks
useLayoutEffect(() => {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
}, [router])
}

return (
Expand Down
12 changes: 8 additions & 4 deletions test/integration/router-is-ready/pages/gsp.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { useRouter } from 'next/router'
import { useLayoutEffect } from 'react'

export default function Page(props) {
const router = useRouter()

if (typeof window !== 'undefined') {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
// eslint-disable-next-line react-hooks/rules-of-hooks
useLayoutEffect(() => {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
}, [router])
}

return (
Expand Down
12 changes: 8 additions & 4 deletions test/integration/router-is-ready/pages/gssp.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { useRouter } from 'next/router'
import { useLayoutEffect } from 'react'

export default function Page(props) {
const router = useRouter()

if (typeof window !== 'undefined') {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
// eslint-disable-next-line react-hooks/rules-of-hooks
useLayoutEffect(() => {
if (!window.isReadyValues) {
window.isReadyValues = []
}
window.isReadyValues.push(router.isReady)
}, [router])
}

return (
Expand Down

0 comments on commit 208a278

Please sign in to comment.