mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-04-20 11:55:37 +00:00
add <Suspense> around every scene object
This commit is contained in:
parent
06256b9396
commit
cb31559bd6
9 changed files with 12 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { lazy } from "react";
|
||||
import { lazy, Suspense } from "react";
|
||||
import type { TorqueObject } from "../torqueScript";
|
||||
import { TerrainBlock } from "./TerrainBlock";
|
||||
import { SimGroup } from "./SimGroup";
|
||||
|
|
@ -51,5 +51,9 @@ const componentMap = {
|
|||
|
||||
export function renderObject(object: TorqueObject, key?: string | number) {
|
||||
const Component = componentMap[object._className];
|
||||
return Component ? <Component key={key} object={object} /> : null;
|
||||
return Component ? (
|
||||
<Suspense>
|
||||
<Component key={key} object={object} />
|
||||
</Suspense>
|
||||
) : null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue