mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### source changes * Error dynamic suspense option in non concurrent mode, don't check react root anymore since they should be bound ### tests changes * Remove duplicated rsc client test * Merge type checking cases (`next/dynamic`) * Remove blocking rendering tests cases since we should opt-in Fizz rendering when using React.lazy * Remove some thrown promises cases, leverage the streaming component we had in RSC test
33 lines
551 B
TypeScript
33 lines
551 B
TypeScript
// use tsx to cover typescript usage of next/dynamic + suspense: true
|
|
|
|
import React from 'react'
|
|
import dynamic from 'next/dynamic'
|
|
|
|
const Red = dynamic(() => import('../../components/red'), {
|
|
suspense: true,
|
|
})
|
|
|
|
function Blue() {
|
|
return (
|
|
<div>
|
|
<p>This is Blue.</p>
|
|
<style jsx>{`
|
|
p {
|
|
color: blue;
|
|
}
|
|
`}</style>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default function StyledJsx() {
|
|
return (
|
|
<>
|
|
<Blue />
|
|
<React.Suspense fallback="Loading...">
|
|
<Red />
|
|
</React.Suspense>
|
|
</>
|
|
)
|
|
}
|