Home > Back-end >  How to hide react source code on web browser?
How to hide react source code on web browser?

Time:11-14

Is there any way to hide react source codes in server side browser(Like google chrome, Firefox, Microsoft Edge). I am seriously stucked with this, as i am trying to develop a react application but it shows all of my source code in the browsers. Any help will be highly appreciated. Thanks.

CodePudding user response:

React is a Frontend library. You are asking how to hide html, css and js source code in browser. If you want to hide your logic from web browser then use a backend. Easiest way is to use Next.j. All the code you write in getServerSideProps() will not be shipped to the browser and only runs on the server. All pages will render server side . This way you can ship only html, css and js to browser without your app logic

CodePudding user response:

You can't hide it necessary, perhaps you could obfuscate it a bit

Here is an article that goes more in-depth: https://code-boxx.com/hide-javascript-code-from-client/

  • Related