admin管理员组

文章数量:1303670

Referring to this ticket here: .js/issues/4210 I'm currently wondering why when you disable javascript, most of the content using relay modern and NextJS does not work.

My initial guess is that since NextJS is a React library for server-side rendering, if JavaScript is disabled in chrome, then obviously React does not work. However, NextJS is server-side rendering so therefore disabling javascript on the client side should not be a problem? Therefore, why does this problem still occur?

Referring to this ticket here: https://github./zeit/next.js/issues/4210 I'm currently wondering why when you disable javascript, most of the content using relay modern and NextJS does not work.

My initial guess is that since NextJS is a React library for server-side rendering, if JavaScript is disabled in chrome, then obviously React does not work. However, NextJS is server-side rendering so therefore disabling javascript on the client side should not be a problem? Therefore, why does this problem still occur?

Share Improve this question asked Jan 22, 2019 at 17:01 its.davidits.david 2,2356 gold badges18 silver badges33 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

In a modern SSR scenario, as in an isomorphic application, only the first rendering is done by the server, that returns plain html content together with the js's that will be used for the subsequents rendering.

In case the browser has javascript disabled you should be seeing only the first rendering as a static page, since what the interpreter does is showing a plain html content, but then you shouldn't be able to interact with the page (that would require js to be enabled)

While @Karim's answer is correct, it is worth pointing out that a user can, technically speaking, partially interact with the page if you use "progressive enhancement". In this case, you use native HTML features to perform operations such as navigation to other pages, form submission, etc. Those do not require JS to be enabled to work correctly. Depending on your target audience, this might be more pain than its worth.

本文标签: reactjsSSR does not work when javascript is disabledStack Overflow