From 6a113c1e9e5f061b76cb8ca01dcbe04eddd1c69c Mon Sep 17 00:00:00 2001 From: Cody Bennett Date: Thu, 2 May 2024 04:10:27 -0500 Subject: [PATCH] fix(Text): don't lazy load troika --- src/core/Text.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/Text.tsx b/src/core/Text.tsx index b51266fd0..65fdbcc19 100644 --- a/src/core/Text.tsx +++ b/src/core/Text.tsx @@ -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' @@ -54,10 +56,6 @@ export const Text: ForwardRefComponent = /* @__PURE__ */ React.forwa }: Props, ref: React.ForwardedRef ) => { - // 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())