@react-three/cannon
Version:
physics based hooks for react-three-fiber
12 lines (8 loc) • 371 B
text/typescript
import type { BodyProps, BodyShapeType } from '@pmndrs/cannon-worker-api'
import { createContext, useContext } from 'react'
export type DebugApi = {
add(id: string, props: BodyProps, type: BodyShapeType): void
remove(id: string): void
}
export const debugContext = createContext<DebugApi | null>(null)
export const useDebugContext = () => useContext(debugContext)