7. React deployment on Nodejs and Express.js (1). Introduction and Production and development discrepancies or errors
1. Build the React app for production @See Achilles Moraites First, use npm start and verify that your application runs ok. Then install serve (if you have not installed it before) and run the production code #Install globally the "serve" javascript web server sudo npm install -g serve #Run the application serve -s buid And now point to " http://localhost:3000 " in your browser and test if it runs well 2. Development and Production irregularities or errors Maybe it cannot run as desired. This "commented" code works in development but not in production // const isFirstRender = useRef(true) ; //Avoid executing code in the beginning useEffect ( ( ) = > { /* Works with development but DO'NT work with production buil d !!!!! if (isFirstRender.current) { isFirstRender.current = false; return; // return early if first r...

Comentarios
Publicar un comentario