Skip to content

Releases: pmndrs/react-ogl

v0.15.1

11 Jul 23:41

Choose a tag to compare

What's Changed

Full Changelog: v0.15.0...v0.15.1

v0.15.0

27 Jan 08:15

Choose a tag to compare

What's Changed

This release adds support for React 19, and removes its own act export in favor of React.act.

Any augmentations or references to global JSX are now to be included in the react module. You can check out the React 19 changelog here.

import { act } from 'react'
import { type OGLElement, extend, render } from 'react-ogl'

declare module 'react-ogl' {
  interface OGLElements {
    customElement: OGLElement<typeof CustomElement>
  }
}

extend({ CustomElement })

const root = createRoot(document.createElement('canvas'))
await act(async () => root.render(<customElement />))

Full Changelog: v0.14.2...v0.15.0

v0.14.2

14 May 22:15

Choose a tag to compare

What's Changed

Full Changelog: v0.14.1...v0.14.2

v0.14.1

03 May 19:20

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.14.0...v0.14.1

v0.14.0

08 Mar 22:13

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.13.0...v0.14.0

v0.13.0

07 Nov 02:55

Choose a tag to compare

What's Changed

Full Changelog: v0.12.0...v0.13.0

v0.12.0

10 Oct 09:19

Choose a tag to compare

What's Changed

Full Changelog: v0.11.0...v0.12.0

v0.11.0

21 Sep 19:35

Choose a tag to compare

What's Changed

This release implements a context bridge within Canvas, enabling react-ogl children to consume context between renderers (e.g. react-dom or react-native), and removing the need for manually bridging context.

import * as React from 'react'
import * as ReactDOM from 'react-dom/client'
import { Canvas } from 'react-ogl'

const DOMContext = React.createContext()

function Component() {
  // "Hello from react-dom"
  console.log(React.useContext(DOMContext))
}

ReactDOM.createRoot(document.getElementById('root')).render(
  <DOMContext.Provider value="Hello from react-dom">
    <Canvas>
      <Component />
    </Canvas>
  </DOMContext.Provider>,
)

Full Changelog: v0.10.1...v0.11.0

v0.10.1

15 Sep 09:41

Choose a tag to compare

What's Changed

No changes in this release. Working around a Bundlephobia issue to get bundle size metrics working again.

Full Changelog: v0.10.0...v0.10.1

v0.10.0

15 Sep 09:33

Choose a tag to compare

What's Changed

This release includes some upstream fixes for suspense and concurrency.

Additionally, portals can now create state enclaves to isolate scenes, cameras, etc. from the root store. This is particularly useful for postprocessing and complex effects.

function Component {
  // scene & camera are inherited from portal parameters
  const { scene, camera, ... } = useOGL()
}

const scene = new OGL.Transform()
const camera = new OGL.Camera()

<transform>
  {createPortal(<Component />, scene, { camera })
</transform>

Full Changelog: v0.9.2...v0.10.0