[v2] add a way to exclude components from SSR within JSX
See original GitHub issue🚀 Feature
Add a way to exclude components from SSR in JSX. Maybe somethin like <NoSSR></NoSSR>.
Have you read the Contributing Guidelines on issues?
yes
Motivation
Right now, each time we use a react lib that doesn’t support SSR we have to put this check {typeof window !== 'undefined' && .... } everywhere inside js and mdx files.
Pitch
Tools like Next js and nuxt provide a way to exclude components from the SSR within the markup. To avoid errors during the build phase we should be able to do se same in a better way than using {typeof window !== 'undefined' && .... } or {typeof document !== 'undefined' && .... }.
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Using Non-SSR Friendly Components with Next.js
Or else, you can create a wrapper component called NonSSRWrapper and then enclose any page in that component to disable SSR. import dynamic...
Read more >Next js - disable server side rendering on some pages
Let's say Comments is our client only component. Now we need to render it only on the client. Here's how we do it....
Read more >How to Disable Server-Side Rendering (SSR) in Next.js
Step 1: Rewrite All Requests to pages/index.js · Step 2: Disable SSR for Page Content · Step 3: Check that Everything Works with...
Read more >A beginner's guide to React Server-Side Rendering (SSR)
In this lesson, we are going to talk about server-side rendering ... and an express server (Node.js) to demonstrate how SSR can be...
Read more >How to implement server-side rendering in your React app in ...
Select FETCH AND RENDER. Once complete, click to see the result. 2. Improve performance. In SSR, the application performance depends on the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Fine, I wrote it on my todo list 📔
Ok I think we can add that, but it is better named
<ClientOnly>/<ClientRenderedOnly>rather than<NoSSR>.