[Next Js]a title element error


March 10, 2023

아래와 같은 에러 발생시

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>JuneTein - {title}</title>

백틱으로 감싸서 아래와 같이 바꿔 줘야 한다.

    <title>{`JuneTein - ${title}`}</title>

카카오톡 공유하기 →