Skip to content

Commit

Permalink
fix(Text): don't lazy load troika (#1947)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored May 2, 2024
1 parent 1c676bc commit bed21ea
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as React from 'react'
// @ts-ignore
import { Text as TextMeshImpl, preloadFont } from 'troika-three-text'
import { ReactThreeFiber, useThree } from '@react-three/fiber'
import { suspend } from 'suspend-react'
import { ForwardRefComponent } from '../helpers/ts-utils'
Expand Down Expand Up @@ -54,10 +56,6 @@ export const Text: ForwardRefComponent<Props, any> = /* @__PURE__ */ React.forwa
}: Props,
ref: React.ForwardedRef<any>
) => {
// https://github.com/pmndrs/drei/issues/1725
// https://github.com/pmndrs/drei/issues/1840
const { Text: TextMeshImpl, preloadFont } = suspend(async () => import('troika-three-text'), [])

const invalidate = useThree(({ invalidate }) => invalidate)
const [troikaMesh] = React.useState(() => new TextMeshImpl())

Expand Down

0 comments on commit bed21ea

Please sign in to comment.