-
카테고리
-
세부 분야
풀스택
-
해결 여부
미해결
styled-components가 적용이 안되는데요
20.03.31 03:24 작성 조회수 725
0
import React from 'react';
import Link from 'next/link'
import styled from 'styled-components'
import { Menu, Input, Button } from 'antd';
const layout = styled.div`
color : white;
`;
const upmenu = styled(Menu)`
color : red;
`;
const AppLayout = ({children}) =>{
return(
<layout>
<upmenu mode="horizontal">
<Menu.Item key="home"><Link href="/"><a>홈1</a></Link></Menu.Item>
<Menu.Item key="country"><Link href="/country"><a>홈2</a></Link></Menu.Item>
<Menu.Item key="mail">
<Input.Search enterButton style={{ verticalAlign: 'middle'}} />
</Menu.Item>
</upmenu>
<Link href="/signup"><a><Button>회원가입</Button></a></Link>
{children}
</layout>
);
};
export default AppLayout;
나머지 페이지는 내용 다 문제없고 styled-components만 적용 안시키면 다 그대로 잘 돌아갑니다 ㅠ
Cannot read property 'getState' of undefined
TypeError: Cannot read property 'getState' of undefined at new Connect (C:\Users\hp\Desktop\react_ex\NodeBird\front\node_modules\mini-store\lib\connect.js:86:57) at processChild (C:\Users\hp\Desktop\react_ex\NodeBird\front\node_modules\react-dom\cjs\react-dom-server.node.development.js:2995:14)
이런에러가 뜨는데 뭐가 문제일까요? menu item도 이름 다 바꿔보기도 했고 styled-components 내용들을 바꿔보기도 하고 다른 프로젝트에서 간단하게 실행해보려고 했는데 다 저 getState 에러가 납니다 ㅠ
답변을 작성해보세요.
0
조현영
지식공유자2020.04.01
Upmenu를 div로 바꾸셨는데 그냥 다시 Menu로 바꿔보세요. 웹팩 빌드가 제대로 안 된 것 같습니다. 아마 import 관계나 그런 것일 수도 있고요.
0
JJeong
질문자2020.03.31
네 4버전 맞아요 스타일드 컴포넌트말고 다른 곳 문제일까요? upmenu를 빼고 div만 적용하면 제대로 작동이 되는데 antd 컴포넌트가 적용이 안되는 것 같습니다 ㅠ
TypeError: styled_components__WEBPACK_IMPORTED_MODULE_5___default.a.div(...) is not a function
menu를 다시 적용시키려하니 이젠 이 에러가 뜨네욤
0
답변 3