React

TroubleShooting

taehyun_kim 2017. 5. 22. 21:46

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 확인 )