-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore: Remove JS props updating via C++ #7684
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
d9285b2
to
5660d44
Compare
packages/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
Show resolved
Hide resolved
UpdateI adjusted the old invalid
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me. I've noticed that sometimes it's jsProp
and sometimes it's jsProps
, perhaps we should unify the identifiers to plural everywhere, i.e. jsPropsNames
instead of jsPropNames
.
apps/common-app/src/apps/reanimated/examples/JSPropsExample.tsx
Outdated
Show resolved
Hide resolved
apps/common-app/src/apps/reanimated/examples/ThirdPartyComponentsExample.tsx
Outdated
Show resolved
Hide resolved
apps/common-app/src/apps/reanimated/examples/ThirdPartyComponentsExample.tsx
Outdated
Show resolved
Hide resolved
…ntsExample.tsx Co-authored-by: Tomasz Zawadzki <[email protected]>
Co-authored-by: Tomasz Zawadzki <[email protected]>
I think it's quite common to add |
…ntsExample.tsx Co-authored-by: Tomasz Zawadzki <[email protected]>
Summary
This PR removes the entire CPP logic of JS props handling and keeps this logic only on the JS side. In the new approach, instead of marking props as JS props for all components with the same native component name, we can easily decide, which props are JS props, separately for each component instance, which is more flexible and safer behavior than before.
The new approach allows these 2 possible ways to declare js props:
getJSProps
method declared on the component class or function component declarationor
options
parameter on thecreateAnimatedComponent
function:If the component has
jsProps
static getter orjsProps
public field already declared andjsProps
were provided inoptions
at the same time,jsProps
from theoptions
argument take precedence over ones declared on the component.