Skip to content

Commit

Permalink
fix: rename useMeasureFont to useMeasureText
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Jun 25, 2024
1 parent c7b7001 commit d949959
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/uikit/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
ImageProperties,
canvasInputProps,
Video,
useMeasureFont,
useMeasureText,
} from '@react-three/uikit'
import { Texture } from 'three'
import { Skeleton } from '../../../packages/kits/default/src/skeleton.js'
Expand Down Expand Up @@ -303,7 +303,7 @@ export default function App() {
}

function MeasureText() {
const measure = useMeasureFont()
const measure = useMeasureText()

useEffect(
() =>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/font.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function useFontFamilies(): FontFamilies | undefined {
/**
* @returns a function that measure the text and returns the width and height if the font is already loaded. Else undefined
*/
export function useMeasureFont(fontFamily?: string, fontWeight?: FontWeight) {
export function useMeasureText(fontFamily?: string, fontWeight?: FontWeight) {
const fontFamilies = useFontFamilies()
const propertiesSignal = useMemo(() => signal<MergedProperties>(new MergedProperties()), [])
propertiesSignal.value = new MergedProperties()
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { FontFamilyProvider, useMeasureFont } from './font.js'
export { FontFamilyProvider, useMeasureText } from './font.js'
export { useRootSize } from './responsive.js'
export {
basedOnPreferredColorScheme,
Expand Down

0 comments on commit d949959

Please sign in to comment.