From cbf8c1ecf0d7a9a6ab3f3601deb9f7cbb73167f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=94?= Date: Thu, 22 Dec 2022 23:53:32 +0100 Subject: [PATCH] fix: gltf types --- README.md | 6 +----- src/core/Gltf.tsx | 9 +++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 044f804b0..89fa59d95 100644 --- a/README.md +++ b/README.md @@ -1298,11 +1298,7 @@ Accepts an SVG url or svg raw data. #### Gltf -

- Demo -

- -This is a convenience component that will load a gltf file and clone the scene using drei/Clone. That means you can re-use and mount the same gltf file multiple times. It accepts all props that Clone does. +This is a convenience component that will load a gltf file and clone the scene using [drei/Clone](#clone). That means you can re-use and mount the same gltf file multiple times. It accepts all props that Clone does, including shortcuts (castShadow, receiveShadow) and material overrides. ```js diff --git a/src/core/Gltf.tsx b/src/core/Gltf.tsx index 77cae6859..77f7d4ba3 100644 --- a/src/core/Gltf.tsx +++ b/src/core/Gltf.tsx @@ -1,13 +1,14 @@ import * as React from 'react' +import * as THREE from 'three' import { useGLTF } from './useGLTF' import { Clone, CloneProps } from './Clone' -type GltfProps = JSX.IntrinsicElements['primitive'] & - CloneProps & { +type GltfProps = Omit & + Omit & { src: string } -export const Gltf = React.forwardRef(({ src, ...props }, ref) => { +export const Gltf = React.forwardRef(({ src, ...props }: GltfProps, ref: React.Ref) => { const { scene } = useGLTF(src) - return + return })