Closed
Description
NextJs 13 introduces a new app
directory for utilizing server components. Client components imported by a server component must have a "use client";
directive similar to strict mode. Using raw
doesn't work because the directive must be above all code/imports.
Here are some ideas I thought of:
// 1. With a directive at the top of file
"use client"
// 2. At anywhere in the top level with a compiler directive
@@directive("use client")
// 3. Change %%raw to put code (or just directives) above imports
%%raw(`"use client";`)
And since so many files will have the same name, #4874 would also help with a big pain point of using NextJs w/ ReScript.
Metadata
Metadata
Assignees
Labels
No labels