diff --git a/packages/editor/src/components/prefabs/PrefabEditors.tsx b/packages/editor/src/components/prefabs/PrefabEditors.tsx index 599534f5cd..2773ed9770 100644 --- a/packages/editor/src/components/prefabs/PrefabEditors.tsx +++ b/packages/editor/src/components/prefabs/PrefabEditors.tsx @@ -18,7 +18,8 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20 Ethereal Engine. All Rights Reserved. */ import config from '@etherealengine/common/src/config' -import { defineState } from '@etherealengine/hyperflux' +import { useGLTF } from '@etherealengine/engine/src/assets/functions/resourceLoaderHooks' +import { defineState, getMutableState, useHookstate } from '@etherealengine/hyperflux' import React, { ReactNode } from 'react' import { FiHexagon } from 'react-icons/fi' @@ -148,5 +149,14 @@ export const PrefabShelfState = defineState({ url: `${config.client.fileServer}/projects/default-project/assets/prefabs/camera.prefab.gltf`, category: 'Camera' } - ] as PrefabShelfItem[] + ] as PrefabShelfItem[], + reactor: () => { + const shelfState = useHookstate(getMutableState(PrefabShelfState)) + return shelfState.value.map((shelfItem) => ) + } }) + +const ShelfItemReactor = (props: { key: string; url: string }): JSX.Element | null => { + useGLTF(props.url) + return null +}