Warning: A title element received an array with more than 1 element as children. In browsers title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering
<title> 태그가 수신할 수 있는 텍스트노드는 1개 뿐인데(공백이거나 최대 1개의 텍스트노드) 지금 내가 썼던 형태는
<title>{title} | Next Movies</title>
이거였다.
해결법은 간단하다
<title>{`${title} | Next Movies`}</title>
이렇게 백틱을 사용해서 하나로 써주면 된다!
에러가 사라진 걸 볼 수 있다.
useEffect로 데이터를 받아오는데
const data 해서 받아오면 네모칸처럼 뜬다. 내가 필요한 건 results 안의 내용이니까
{ results } 로 받아오면 제대로 results만 뜨는 걸 볼 수 있다.
여기서 useState에 빈 array를 넣지 않으면 에러가 난다. movies.map에서 movies가 undefined라고