Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING: expose JSX OGLElements, improve reconciler type-safety #54

Merged
merged 3 commits into from
Jul 8, 2022

Conversation

CodyJasonBennett
Copy link
Member

@CodyJasonBennett CodyJasonBennett commented Jul 8, 2022

Improves internal reconciler type safety by filling out the reconciler's host config types. Also exposes JSX elements defined by react-ogl 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 })
@CodyJasonBennett CodyJasonBennett marked this pull request as draft July 8, 2022 01:12
@CodyJasonBennett CodyJasonBennett marked this pull request as ready for review July 8, 2022 01:29
@CodyJasonBennett CodyJasonBennett merged commit d162f0f into main Jul 8, 2022
@CodyJasonBennett CodyJasonBennett deleted the refactor/instance-types branch July 8, 2022 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant