@croquet/react
Version:
React bindings for Croquet
10 lines (9 loc) • 397 B
JavaScript
import { useCroquetContext } from './useCroquetContext';
/** Hook that gives access to the root Model of this croquet session.
* Can be used to read Model properties (including other referenced Models),
* and to publish events to the Model or to subscribe to Model events using the other hooks.
*/
export function useModelRoot() {
const { model } = useCroquetContext();
return model;
}