mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This PR adds a test to confirm that the component will be committed after the stylesheet is loaded, by delaying the CSS request in middleware and then check the active style in `useEffect` (technically it should be `useLayoutEffect`). Since our current timeout for that is set to 500ms, I also added a test with 1000ms delay to rule out false negative cases.
23 lines
386 B
JavaScript
23 lines
386 B
JavaScript
'use client'
|
|
|
|
import Link from 'next/link'
|
|
import { useEffect } from 'react'
|
|
|
|
import './style.css'
|
|
|
|
export default function Page() {
|
|
useEffect(() => {
|
|
console.log(
|
|
(window.__log =
|
|
'background = ' +
|
|
window.getComputedStyle(document.body).backgroundColor)
|
|
)
|
|
}, [])
|
|
|
|
return (
|
|
<div>
|
|
<Link href="/suspensey-css">Get back</Link>
|
|
</div>
|
|
)
|
|
}
|