Skip to content

Commit

Permalink
Revert "fix(Text): lazy import Troika for Next issue (#1726)" (#1767)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Dec 26, 2023
1 parent a82d0d4 commit a8da89c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 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 @@ -52,9 +54,6 @@ export const Text: ForwardRefComponent<Props, any> = /* @__PURE__ */ React.forwa
}: Props,
ref: React.ForwardedRef<any>
) => {
// https://github.com/pmndrs/drei/issues/1725
const { Text: TextMeshImpl, preloadFont } = suspend(async () => import('troika-three-text'), [])

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

Expand Down

1 comment on commit a8da89c

@vercel
Copy link

@vercel vercel bot commented on a8da89c Dec 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.