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

feat(native): implement native EventTarget methods #3252

Merged
merged 8 commits into from
Aug 10, 2024

Conversation

CodyJasonBennett
Copy link
Member

Resolves #3173

Copy link

codesandbox-ci bot commented May 5, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 46d81ce:

Sandbox Source
example Configuration

Comment on lines 148 to 213
<View {...props} ref={viewRef} onLayout={onLayout} style={{ flex: 1, ...style }} {...bind}>
<View {...props} ref={viewRef} onLayout={onLayout} style={{ flex: 1, ...style }}>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should allow props to be spread from libraries like https://github.com/TiagoCavalcante/r3f-native-orbitcontrols which also use responder props.

@TiagoCavalcante
Copy link

What is the state of this PR?

@CodyJasonBennett
Copy link
Member Author

CodyJasonBennett commented Aug 4, 2024

I need to test this and see how far off we are from supporting controls from three/examples, or libraries like pmndrs/use-gesture which are a bit more elaborate with usage. This was put on the backburner as we had some core issues with our events model for XR, which may be relevant for multi-touch or general correctness. We found an elegant way to continue which we'll implement later, so this doesn't need to be blocked. This PR just needs to support controls and the previous suspects that made canvas event props not work as they should. We may be able to backport the latter alongside #3315 if this takes too long.

@ashkalor
Copy link

ashkalor commented Aug 9, 2024

Waiting for this update as well.
I tried my hand at implementing the gestures on my own from react native gesture handler but canvas doesn't seem to be receiving any of the events from that.

@CodyJasonBennett
Copy link
Member Author

I'm back from SIGGRAPH and work this week, so I'll be continuing here. I think for responder props to work on the canvas, {...bind} needs to be moved to the GLView or a hidden View where we don't spread user-land props.

@CodyJasonBennett CodyJasonBennett merged commit 4ec3cb0 into master Aug 10, 2024
2 checks passed
@CodyJasonBennett CodyJasonBennett deleted the feat/native-eventemitter branch August 10, 2024 09:53
@ashkalor
Copy link

@CodyJasonBennett, Hey there seems to be no typings in the latest release. Declarations folder is not present for v18.17.1 inside node_modules when i checked.

@CodyJasonBennett
Copy link
Member Author

Fixed. #3331.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support some type of addEventListener on native Canvas
3 participants