elements icon indicating copy to clipboard operation
elements copied to clipboard

Feature Request: Support react server components

Open danteissaias opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Which Mux Elements/Packages does this apply to? Select all that apply

mux-video-react, mux-audio-react, mux-player-react

Description

Add "use client" directive to the output bundle. https://beta.nextjs.org/docs/rendering/server-and-client-components#convention

Expected Behavior

N/A

danteissaias avatar May 04 '23 10:05 danteissaias

Thanks for this @danteissaias !

@decepulis I think you looked into this, any reason we should not add the "use client" directive ourselves?

dylanjha avatar Jun 23 '23 20:06 dylanjha

Thanks, @danteissaias! And yeah @dylanjha we should totally do this.

The only gotcha, esbuild strips out directives like "use client", so we'll have to consider postbuild steps for adding the directive back. I know @luwes considering approaches over in #712

decepulis avatar Jun 27 '23 16:06 decepulis

Thanks, @danteissaias! And yeah @dylanjha we should totally do this.

The only gotcha, esbuild strips out directives like "use client", so we'll have to consider postbuild steps for adding the directive back. I know @luwes is already on it.

"use client" can be added as a banner

danteissaias avatar Jun 27 '23 16:06 danteissaias