I got a React-app project in which I installed npm and Redux Toolkit.
After having added a store provider for the whole app in this way
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import './index.css';
import App from './App';
import store from './store/index';
ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root'));
if I npm start the app I get this error:
Module not found: Can't resolve 'react-redux' in '/Desktop/React/redux-app/src'
I've read on the official Redux site:
Redux Toolkit includes the Redux core, as well as other key packages we feel are essential for building Redux applications
So I guess that having Redux Toolkit alone should be enough to resolve any react-redux module.
I noticed that my package.json and package-lock.json are in the directory from which I run npm start, that is /redux-app while the module is not found in /redux-app/src. Is that fine? Should I move the .json files? How can I fix the problem in general?