Repository navigation
v0.6.0
What's Changed
- BREAKING: expose JSX OGLElements, improve reconciler type-safety by @CodyJasonBennett in #54
- fix(types): mark OGL helpers as effectful, correctly infer hook types by @CodyJasonBennett in #56
- fix: create separate native entrypoint by @CodyJasonBennett in #57
- fix: use useLayoutEffect in native by @CodyJasonBennett in #55
- chore: add docs, rework information architecture by @CodyJasonBennett in #58
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