UNPKG

@playcanvas/react

Version:

A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.

19 lines (18 loc) 576 B
import { ForwardedRef } from 'react'; import { Script } from 'playcanvas'; import { SubclassOf } from '../utils/types-utils.ts'; /** * This hook is used to create a script component on an entity. * @param scriptConstructor - The constructor for the script. * @param props - The props for the script. * * @example * const script = useScript(MyScript, { * myProperty: 'value', * }); */ export declare const useScript: (scriptConstructor: SubclassOf<Script>, props: Props, ref: ForwardedRef<Script>) => void; interface Props { [key: string]: unknown; } export {};