imzbf / md-editor-rt

Markdown editor for react, developed in jsx and typescript, dark theme、beautify content by prettier、render articles directly、paste or clip the picture and upload it...
https://imzbf.github.io/md-editor-rt
MIT License
312 stars 43 forks source link

Isn't ssr supported in next14 #135

Closed OWOfadeAway closed 6 months ago

OWOfadeAway commented 6 months ago

Describe the issue

Isn't ssr supported in next14 , Reminds me that I need to write use client,I only used MdPreview and MdCatalog。 image image

image

Procedure version

next@14 md-editor-rt@4.11.2

Reproduction link

No response

imzbf commented 6 months ago

This component is not a server component in nextjs. So you need to write use client in this component.

Server side rendering is still available.

OWOfadeAway commented 6 months ago

Will the current component perform server-side rendering when I use 'use client'?

OWOfadeAway commented 6 months ago

image and I don't think I used any client components

imzbf commented 6 months ago

Will the current component perform server-side rendering when I use 'use client'?

Yes, to verify it, you only need to use Postman to access your page

imzbf commented 6 months ago

image and I don't think I used any client components

Perhaps it is necessary to understand the differences between the client and server components of nextjs.

OWOfadeAway commented 6 months ago

I know the difference,MdPreview and MdCatalog aren't server components?

imzbf commented 6 months ago

I know the difference,MdPreview and MdCatalog aren't server components?

Correct, the editor contains a substantial amount of state and interactions, making it unsuitable for design as a server component.

OWOfadeAway commented 6 months ago

thank u ! @imzbf