Created
November 4, 2022 01:01
-
-
Save robksawyer/fa8c785028a09e15e77b95dd382e7d45 to your computer and use it in GitHub Desktop.
Simple helper to load a font with React Three Fiber
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FontLoader } from 'three-stdlib'; | |
import { useLoader } from '@react-three/fiber'; | |
export const useFont = (src) => { | |
return useLoader(FontLoader, src); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment