Skip to content

@remotion/player: RSC support (prepend 'use client' while bundling to player files) #2313

@Just-Moh-it

Description

@Just-Moh-it

Currently, to use <Player /> in react server components, we need to manually create a file with the 'use client' directive, and that doesn't work well either, since all of remotion's source files don't have 'use client', so they get treated as server files by default.

Even though there are very less use cases where a could be used in a server component, it still makes sense for to have the directive, in case it is ever imported in a server component.

Workaround (sort of)

Currently, you could create a custom component with a name like <UseClientPlayer /> that is a wrapper around <Player />. But creating that component with typescript requires some serious generics and other stuff to completely copy <Player />'s props.

Would be great if @remotion/player files could have the directive.

Useful, maybe

rollup/rollup#4699

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions