-
Notifications
You must be signed in to change notification settings - Fork 24.8k
feat: Add getConcretePropsShared()
#48710
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
Conversation
(not yet tested, if you think its a good idea I'll test this better) |
packages/react-native/ReactCommon/react/renderer/core/ConcreteShadowNode.h
Outdated
Show resolved
Hide resolved
Could you explain a bit more what you're trying to do here? Maybe share how you'd this API in Nitro Views? Generally, this API is fine, as we already expose the same as |
…ShadowNode.h Co-authored-by: Pieter De Baets <[email protected]>
Sure! So in Nitro Views, I have my own Fabric component, and because of how React Android works, there was no direct way to access the Android View through the C++ So a working solution we found instead was to use C++ State (the last type argument for This C++ state will be passed to Java using Then in there, I call a JNI function which unwraps the Now to the problem: The But right now I am "blocked" by something else; react-native has special parsing for function props to convert them into events. The native side just receives a boolean ( |
packages/react-native/ReactCommon/react/renderer/core/ConcreteShadowNode.h
Outdated
Show resolved
Hide resolved
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @mrousavy in f830f2c When will my fix make it into a release? | How to file a pick request? |
Summary:
Adds
getConcretePropsShared()
toConcreteShadowNode.h
.I need this in Nitro Views to update state in-place without throwing away the old state object and creating a new one each time.
From reading the code it seems like you use this pattern a lot tho where you create new State objects each time - so let me know if my thing is a bad idea..
Changelog:
getConcretePropsShared()
toConcreteShadowNode.h
Test Plan:
Use in Nitro