I have an component which I want to import 'homeSlice'
Home slice (which is located in the 'pages' folder) :
import { createSlice } from "@reduxjs/toolkit";
const initialState = [
{ id: 1, name: "Andy" },
{ id: 2, name: "Nathan" },
{ id: 3, name: "Andrei" },
];
const homeSlice = createSlice({
name: "users",
initialState,
reducers: {},
});
export const selectHomeUsers = (state) => state.home;
export const homeReducer = homeSlice.reducer;
And then I have another component in which I make the next import :
import {homeReducer} from 'pages';
And I have the next jsconfig.json file :
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"*": ["src/*"]
}
}
}
But when I try to run the app, I get the error that there is no module found 'pages'.