@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
19 lines (18 loc) • 573 B
TypeScript
import { ForwardedRef } from 'react';
import { Script } from 'playcanvas';
import { SubclassOf } from '../utils/types-utils';
/**
* 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 {};