pages/_app.tsx
에서
import '../styles/globals.css';
import theme from '../styles/globals'
import { ThemeProvider } from 'styled-components';
import GlobalStyle from '../styles/globals';
function MyApp({ Component, pageProps }) {
return (
<ThemeProvider theme={GlobalStyle}>
<Component {...pageProps} theme={theme}/>
</ThemeProvider>
)
}
export default MyApp;
import { ThemeProvider } from 'styled-components';
import GlobalStyle from '../styles/globals';
두개를 import 해주고
<ThemeProvider theme={GlobalStyle}>
<Component {...pageProps} theme={theme}/>
</ThemeProvider>
Thmeprovider 로 감싸서 theme을 전역으로 내려줘야한다.