Semantic Diff

#9289 JSX v4: keep an async component's @directive on its own function

1 commit

b82d9443d37d9d1bbabcf7107919667790df5a14..pr-9289

8f971d792 · open-session-os-tella-dev[bot] + Jaap Frolich · Nov 09, 2026, 19:12 UTC

JSX v4: keep an async component's @directive on its own function

The JSX PPX moved every attribute of a component's function onto the generated props => make(props) wrapper. For an async component that wrapper is a sync function returning make's promise, so

@react.component let make = @directive("'use cache'") async (~id) => ...

compiled to function Name(props) { 'use cache'; return make(props); }, which Next.js rejects ("'use cache' functions must be async"). A directive on an async component now stays on make, which the wrapper then reduces to. Sync components are unchanged: their wrapper inlines make, so the directive already lands on the one function.