Отреагировать с 18 по 17
When You Using
npx create-react-app app-name
it will always install latest react packages. Then, in react 18.2.0, It is some of different about previous version.
If you want to downgrade your current react version to previous version of react, Try These 5 Steps.
You go to your folder file structure and delete both package-lock.json ( yarn.lock for yarn) file and node_modules file.
After you go to your package.json file and change and edit these dependencies :
"react": "^18.2.0",
"react-dom": "^18.2.0",
to
"react": "^17.0.2",
"react-dom": "^17.0.2",
in your package.json dependencies file like this.
After go to Your index.js file change,
import ReactDOM from 'react-dom/client'
to
import ReactDOM from 'react-dom';
After change your index.js file and change below part of index file.
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')
);
Finally, You can open the terminal and run
if you are using npm -->> npm install
Better Beaver