Is it possible to create a react app that runs when Javascript is disabled in browser?
Asked Answered
W

2

5

I am developing a reactjs site and I want to make that site running even when the javascript is disabled in browsers. Is it possible? how to develop a react site that runs on both conditions (Enabled and disabled of Javascript) for ex: fb, StackOverflow are running even javascript is disabled how it happens?

Worked answered 13/1, 2020 at 6:54 Comment(0)
N
5

React is a JavaScript framework for the front-end. Which means it executes in the browser. If you disable JavaScript in the browser, React doesn't work anymore. Just in the same way if you delete Photoshop from your computer, you can't open .psd files anymore.

If you really must support browsers without JavaScript (which most people don't), you need to build your app to work with plain old HTML based navigation (think links, forms etc).

It's possible to use React (for people with JS enabled) and a fallback for those without, this approach is called Progressive Enhancement. Might be useful to you: https://softwareengineering.stackexchange.com/questions/25969/should-i-bother-to-develop-for-javascript-disabled

Nickolasnickolaus answered 13/1, 2020 at 6:58 Comment(1)
Developing for JS enabled users first with a fallback for non JS users would be graceful degradation, not progressive enhancements.Antifouling
S
2

First thing, React is a javascript library so it depends on Javascript. But you can use server side rendering like Next.js and render the content on server side. But still user cannot use any react feature in browser.

It's good to render the initial content on screen.

Stackoverflow renders the initial content on server and sends the initial rendered content to the browser.

It's also good for SEO.

Shamikashamma answered 13/1, 2020 at 6:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.