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: Create React Native ViewManager (+ Props + State) for HybridViews #500

Merged
merged 29 commits into from
Jan 20, 2025

Conversation

mrousavy
Copy link
Owner

@mrousavy mrousavy commented Jan 15, 2025

Actually update props in the Swift/Kotlin view when they change in C++/JSI.

This makes Nitro Views ready for beta testing

Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
nitro-docs ⬜️ Skipped (Inspect) Jan 20, 2025 3:19pm

@hannojg
Copy link
Contributor

hannojg commented Jan 16, 2025

Ah, there might be some caveat about passing a callback as prop. These are implemented differently in react-native/fabric. They are just hold on the JS side and a general purpose native event emitter emits an event from native to js to call this callback and then its called from the JS side (if I am not mistaken).
So it might be that callbacks are handled differently during prop parsing, and are just passed as boolean to native 🥶 will check / confirm later today!

(A quick fix would be to box those, but I know how much you would hate that 😄 )

@mrousavy
Copy link
Owner Author

I thought the whole point of this was to have a point where we can access props as jsi::Values before React Native does any processing?

@mrousavy
Copy link
Owner Author

(A quick fix would be to box those, but I know how much you would hate that 😄 )

very much

@hannojg
Copy link
Contributor

hannojg commented Jan 16, 2025

@mrousavy that might happen on the JS side already, not on the native side

@mrousavy
Copy link
Owner Author

so worst case we need a PR that customizes/removes this behaviour from the JS side - maybe a third param to the getHostComponent thingy

@mrousavy mrousavy changed the title feat: Connect actual prop parsing for Nitro Views feat: Create React Native ViewManager (+ Props + State) for HybridViews Jan 20, 2025
Copy link
Owner Author

@mrousavy mrousavy left a comment

Choose a reason for hiding this comment

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

looks good nice work @mrousavy

@mrousavy
Copy link
Owner Author

thanks

@mrousavy mrousavy merged commit baed798 into main Jan 20, 2025
17 checks passed
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.

2 participants