0
votes

I am using styled-components in a React project. So far it has been working fine, but now I want to use the react-datepicker package, which requires its styles to be imported the following way:

import "react-datepicker/dist/react-datepicker.css";

However, importing the file causes an error that says "You may need an appropriate loader to handle this file type". I know I could fix this by creating a handler for .css files, but I thought I could avoid that by using Styled Components.

My question is, is there a way to handle these type of imports with styled components? I've been loooking online for hours and can't seem to find a way.

1
css-loader ?? - BugsArePeopleToo

1 Answers

0
votes

I ended up just forking the project and changing it to use styled-components instead of needing to import the styles.