본문 바로가기

React

TroubleShooting

1. Uncaught Error : Invariant Violation: Element type is invalid: expected a string ( for built-in components) or a class/function but got:object


 import { Router } from 'react-router' : imports the default export

 import Router from 'react-router'  : imports the export 'Router' from the file


2. Unterminated JSX contents





3. <Login/> 화면이 보이지 않은 문제 ( this.props.children )


 상황 : this.props.children에 <Login/> 태그가 붙지 않아 화면에 나타나지 않음

 원인 : warning : you should not use <Route component> and <Route children> in the same route; <Route children> will be ignored

 해결 : react-router가 v4로 가면서 nested route component를 지원하지 않아서 nested하지 않게 짜줌 ( commit log 확인 )


'React' 카테고리의 다른 글

#4. React 성능과 렌더링  (0) 2017.06.19
Tip  (0) 2017.05.23
#3. Redux  (0) 2017.05.23
#2. ReactJS 시작하기  (0) 2017.05.16
#1. ReactJS 소개  (0) 2017.05.15