0.13.1 • Published 4 months ago

@use-gpu/react v0.13.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

@use-gpu/react

npm install --save @use-gpu/react
yarn add @use-gpu/react

Docs: https://usegpu.live/docs/reference-components-@use-gpu-react

Live - React interface

<HTML> (Live → React)

Embed React content inside Live, to render HTML. Portal from Live to React.

  • container: string | HTMLElement - Containing element (or CSS selector) to render into.
  • children: React.ReactNode - React children to render
import { HTML } from '@use-gpu/react';

// In Live component:
<HTML container={container}>
  {children}
</HTML>

<LiveCanvas> (React → Live)

Embed Live <canvas> inside React. Portal from React to Live.

  • children: (canvas: HTMLCanvasElement) => LiveElement - Live children to render
import { LiveCanvas } from '@use-gpu/react';
import { WebGPU, AutoCanvas } from '@use-gpu/webgpu';

// In React component:
<LiveCanvas>{
  (canvas) =>
    // Render Live components here, e.g.
    <WebGPU>
      <AutoCanvas canvas={canvas} />
    </WebGPU>  
}</LiveCanvas>

<Live> (React → Live)

Run bare Live fiber inside React. Portal from React to Live.

  • children: LiveElement - Live root to render
import { Live } from '@use-gpu/react';

const Raw = () => {
  // ...
};

// In React component:
<Live>
  <Raw />
</Live>

Colofon

Made by Steven Wittens. Part of @use-gpu.

0.13.0

5 months ago

0.13.1

4 months ago

0.12.0

10 months ago

0.11.3

11 months ago

0.11.1

12 months ago

0.11.0

1 year ago

0.9.3

2 years ago

0.10.1

2 years ago

0.9.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.8.3

2 years ago

0.8.0

2 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago