Skip to content

v0.6.0

Choose a tag to compare

@CodyJasonBennett CodyJasonBennett released this 24 Jul 01:59
· 54 commits to main since this release

What's Changed

Changes

This release improves typesafety and react-native resolution issues. We also now have documentation (see readme).

OGL & Node/SSR

OGL's module resolution works as of 0.97 and is the minimum required version for react-ogl 0.6. Previous workarounds for Node/SSR are no longer needed.

OGLElements

JSX elements defined by react-ogl are now exposed as OGLElements. These can now be accessed deterministically from the OGLElements export, and modified with the following:

import { Node, extend } from 'react-ogl'

class CustomElement {}

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

extend({ CustomElement })

See Creating custom elements via extend.

useLoader

useLoader will now properly infer types from loaders, and accepts a LoaderRepresentation signature for custom loaders.

class CustomLoader {
  async load(gl: OGLRenderingContext, url: string): Promise<void> {}
}

const result = useLoader(CustomLoader, '/path/to/resource')

See Loading assets via useLoader.

Full Changelog: v0.5.1...v0.6.0