mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
makes the object returned by `cookies() check if the phase we're currently in allows mutations. - `(await cookies()).set(...)` will no longer be allowed in a render that follows an action (previously, this'd work, because `actionStore.isAction` is still true during the render!) - `unstable_after(async () => (await cookies()).set(...))` will error - `const store = await cookies(); unstable_after(() => store.set(...))` will now also error this affects a couple places that mutate cookies in a way that we don't let userspace code do, like draftmode. to support this, i've added `workUnitStore.userspaceMutableCookies` and made *only that one* check for invalid accesses. that's the one we return from `cookies()` in a mutable context. the rest of the codebase can continue using `workUnitStore.mutableCookies` without worrying about phase checks.
11 lines
172 B
TypeScript
11 lines
172 B
TypeScript
import * as React from 'react'
|
|
|
|
export default function AppLayout({ children }) {
|
|
return (
|
|
<html>
|
|
<head></head>
|
|
<body>{children}</body>
|
|
</html>
|
|
)
|
|
}
|