I'm importing Sick carousel's CSS to my root component like this:
import React from 'react'
import PropTypes from 'prop-types'
import { ThemeProvider } from 'styled-components'
import { AppContext } from 'services/AppContext'
import Layout from 'components/blocks/Layout'
import { GlobalStyle, AppContainer } from 'shared/styles'
import theme from 'theme'
import 'slick-carousel/slick/slick.css'
import 'slick-carousel/slick/slick-theme.css'
function App({ Component, pageProps }) {
return (
<AppContext.Provider value={{ foo: 'bar' }}>
<ThemeProvider theme={theme}>
<AppContainer>
<GlobalStyle />
<Layout>
<Component {...pageProps} />
</Layout>
</AppContainer>
</ThemeProvider>
</AppContext.Provider>
)
}
App.propTypes = {
Component: PropTypes.elementType.isRequired,
pageProps: PropTypes.object.isRequired,
}
export default App
The problem is that the styles are not being applied to my carousel.
I have tried to import the CSS in the component which needs it, but next.js is giving me the error that either I have to import it in the root component or make it component level CSS, which I don't know how to do.
Any suggestions please?