useEffect(() => {
const titleElement = document.getElementsByTagName("title")[0];
const path = window.location.pathname;
if (path === "/courseByType/3D") {
titleElement.innerHTML = "메타버스 창작코딩";
} else if (path === "/courseByType/JSPython") {
titleElement.innerHTML = "앱 창작 코딩/프로젝트";
} else {
titleElement.innerHTML = "앱 창작 코딩/블록코딩";
}
}, [])
의외로 쉽고 간단하게 끝나죠잉 ? 😎
++
window.location 의 다른 기능들도 보고 싶다면 아래 사이트 참고 !!
-> https://hianna.tistory.com/464