2. FrontEnd/Three.js
[R3F] Next에 R3F 적용하고, Text 넣는 방법
문제 Next@13.2.0버전에 @react-three/fiber^8.15.11, @react-three/drei^9.88.17, three^0.158.0을 적용하고, 다음 코드와 같이 텍스트를 Canvas에 감싸면 렌더링 되겠지 했더니 다음과 같은 에러가 난다. 이렇게 텍스트 넣으려고 했는데, 오류남 {children} Text is not allowed in the R3F tree! This could be stray whitespace or characters. 해결방법1 다음과 같은 Text컴포넌트를 만들어서, json으로 된 폰트를 지정하여 텍스트 렌더링하는 방법 // Import necessary dependencies import { useEffect, useMemo } from 'react..
2023. 11. 27. 16:41