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

Add react-native-svg interface #3242

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft

Conversation

latekvo
Copy link
Contributor

@latekvo latekvo commented Nov 27, 2024

Description

This PR adds integration with the react-native-svg (RNSVG) to improve hitbox detection of the SVG elements they provide.

blocked by software-mansion/react-native-svg#2583
blocked by nested SvgViews with viewBox prop have invalid hit detection - No issue opened yet

Test plan

  • use the newly added SVG integration example to see how it works

@latekvo latekvo changed the title Integrate with react-native-svg for improved hit detection of svg elements Add interaction with react-native-svg to improve hit-boxes of svg elements Nov 27, 2024
@latekvo latekvo changed the title Add interaction with react-native-svg to improve hit-boxes of svg elements Add react-native-svg interface Nov 27, 2024
@latekvo
Copy link
Contributor Author

latekvo commented Nov 28, 2024

Integration works as of bd51ac7, but I have to test it a bit more before it's ready.

jakex7 pushed a commit to software-mansion/react-native-svg that referenced this pull request Nov 28, 2024
…interface (#2555)

<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect -->

# Summary

Adding an `RNGH <-> RNSVG` interface requires usage of
`RenderableView.hitTest` to work.
([link](software-mansion/react-native-gesture-handler#3242))
Currently, `RenderableView.hitTest` is `package-private`, meaning it
cannot be accessed by other packages.
This change does not change any functionality of the library, it only
exposes existing functions to other libraries.

I only made public those `hitTest` implementation which are strictly
necessary for this interface, this is why multiple, if not most
`hitTest` implementations remain `package-private` despite the changes
made in the PR.

## Test Plan

- open the example app, see how the app builds successfully

### What's required for testing (prerequisites)?

- `RNSVG`'s `paper-example` app

### What are the steps to reproduce (after prerequisites)?

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |    ❌      |
| MacOS   |    ❌      |
| Android |    ✅      |
| Web     |    ❌      |

## Checklist

<!-- Check completed item, when applicable, via: [X] -->

- [X] I have tested this on a device and a simulator
- [ ] I added documentation in `README.md`
- [ ] ~~I updated the typed files (typescript)~~
- [ ] I added a test for the API in the `__tests__` folder
@latekvo latekvo changed the base branch from main to next December 5, 2024 15:17
@latekvo latekvo changed the base branch from next to main December 18, 2024 14:31
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.

1 participant