I have create the app using create-react-app. Then I installed the react-table package(using command npm install --save react-table). When I started my application I am getting Module not found: Can't resolve 'react-table/react-table.css' this error.
Any suggestion how to resolve this. Thanks in advance !
To solve the "Module not found: Can't resolve" error in React, make sure to install the package from the error message if it's a third-party package, e.g. npm i somePackage . If you got the error when importing local files, correct your import path.
This error is generated because the compiler is only able to import files from the src folder. Here, the CSS file is saved outside the src folder, so the compiler failed to import it. To make this code work, you just have to save the CSS file inside the src folder.
To solve the error "Module not found: Error: Can't resolve 'react-bootstrap'", make sure to install the react-bootstrap package by opening your terminal in your project's root directory and running the command npm install react-bootstrap bootstrap and restart your dev server.
To solve the error "Module not found: Error: Can't resolve 'bootstrap/dist/css/bootstrap.min.css'", make sure to install the bootstrap package by opening your terminal in your project's root directory and running the command npm install bootstrap and restart your dev server.
We can easily create custom css for react-table and there is a lot of examples online. The current version of react-table is 7. React table 6th version supports the cs, You should install react-table version-6.
Open your terminal in your project's root directory (where your package.json file is located) and run the following commands: The command will add the react-bootstrap package to the dependencies of your project. Make sure to restart your development server and your IDE if necessary.
You should install react-table version-6.
$ npm install react-table-6
and then import these,
import ReactTable from "react-table-6";
import "react-table-6/react-table.css"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With