Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

downgrade react 18 to 17

npm install --save react@17.0.2 react-dom@17.0.2
Comment

downgrade react version to 17

npm install --save react@17.0.2 react-dom@17.0.2
Comment

How to downgrade from React 18 to React 17

1) From your main folder, delete: 
	a) package-lock.json file (or yarn.lock for yarn) 
	b) node_modules folder (from the terminal you can type 'rm -Rf node_modules')

2) Go to your package.json file and change these dependencies:
    FROM
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    TO
    "react": "^17.0.0",
    "react-dom": "^17.0.0",
    (You can choose the exact version you want to install)

3) Go to index.js file (src/index.js) and edit it the following way:
	a)	Change the import part of index.js:
    	FROM
	    import ReactDOM from 'react-dom/client'
		TO
		import ReactDOM from 'react-dom';
		(you just have to remove the '/client' from the import)
	
	b) Change the below part of index.js:
    	FROM 
        const root = ReactDOM.createRoot(document.getElementById('root'));
		root.render(
          <React.StrictMode>
            <App />
          </React.StrictMode>
        );

		TO
        ReactDOM.render(
          <React.StrictMode>
            <App />
          </React.StrictMode>,
          document.getElementById('root')
        );

4) Open the terminal and run 'npm install' (or 'yarn install').
Comment

PREVIOUS NEXT
Code Example
Shell :: how to restart psql in linux 
Shell :: install lutris kali linux 
Shell :: odd even in shell script 
Shell :: xrandr add 1366 
Shell :: install transmission ubuntu 
Shell :: install aws cli in ec2 centos 
Shell :: ufw enable 
Shell :: ngrok manjaro 
Shell :: install deb file 
Shell :: check bash version 
Shell :: composer remove package 
Shell :: emacs ubuntu install 
Shell :: bash for loop find 
Shell :: linux check os version ubuntu or centos 
Shell :: checkbox github markdown 
Shell :: bash search file in directory 
Shell :: locale setting linux 
Shell :: Remove the credentials of git 
Shell :: failed to start docker application container engine 
Shell :: how to install rich in python 
Shell :: show users in sudo group 
Shell :: error: failed to push some refs to 
Shell :: git@bitbucket.org: Permission denied (publickey). 
Shell :: ubuntu keeps freezing 20.04 
Shell :: command to find Server’s Public IP Address using curl 
Shell :: uninstall eclipse ubuntu 20.04 
Shell :: remove mariadb 
Shell :: start grafana server 
Shell :: kill service by port number on windows 
Shell :: how to check if ip is up bash script 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =