본문 바로가기
웹개발/잡다한

[React 에러] Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

by julysein 2020. 11. 12.
728x90

client.jsx에서 다른 함수를 부르는 상황이었다.

react에서는 다른 함수를 불러올 수 있는 방법이 import 와 require이 있다.

client.jsx에서는 require로 다른 함수를 부르고 그 함수에서는 import 로 react 등을 불러왔더니 저런 에러가 발생했다.

그래서 require하나로 통일시켰더니 해결되었다.

728x90