Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 591 Bytes

File metadata and controls

35 lines (25 loc) · 591 Bytes

Gabber React SDK

Hooks and provider for React apps.

Install

npm install @gabber/client-react

Quickstart

import { EngineProvider, useEngine } from '@gabber/client-react'

export function App() {
  return (
    <EngineProvider>
      <Main />
    </EngineProvider>
  )
}

function Main() {
  const { connect, connectionState } = useEngine()

  useEffect(() => {
    connect({ url: 'your-gabber-url', token: 'your-token' })
  }, [connect])

  return <div>State: {connectionState}</div>
}

See src/ for hooks like usePad, usePropertyPad, useSourcePad.