-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
No matching function for call to 'fromRawValue' #35054
Comments
cc @cipolleschi |
Hi @kalyantm! Something like interface Action {
id: string;
action: string;
} And then use it like: //.. other props..
actions: readonlyArray<Action> Can you try something like this and tell me if it works? Thank you so much! |
@cipolleschi Nope, did not work, i get an error when i run
|
@cipolleschi However, it does build if I define it like this:
But this again, leads to the same error in XCode: |
Hum... That's weird, this should actually work. |
I think I found the problem, @kalyantm. Could you try to add that header to the If we confirm that this is the problem, we can fix it in the Codegen for everyone! |
It puzzles me because here headers share a completely similar setup and the maintainer said that they are working... 🤔 but he is also testing against 0.69... although, I'm not aware of any changes on the Codegen related to this behavior... |
@cipolleschi Yup, including that header fixed it for me! |
Summary: Generated props with custom structs generates implement their own version of `fromRawProps` in the header file, which has to invoke `fromRawProps` in the framework which is not available. This Diff adds the missing header in the generated `Props.h` file and updates the tests. This should also fix [this issue] facebook#35054. ## Changelog: [General][Fixed] - Add missing header in the Codegen for props with object types. Differential Revision: D40674432 fbshipit-source-id: c18ea0941c252acfb9d42ef240940fccab2231a1
@cipolleschi Is this merged in? I still have to manually add this in everytime I build 😅 |
No, unfortunately, it has not been merged, as the problem is more vicious than expected. We have other reports of this problem and I'm planning to fix it properly as soon as I have some time. |
This commit a00cea4 may fix the problem. Would you mind try it locally and let me know if it works? We may be able to cherry pick it for 0.71.3 if that's the case. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Fix shipped in 0.72 |
Description
I'm trying to build a fabric native react component, and I'm following the steps as outlined here: https://reactnative.dev/docs/next/the-new-architecture/pillars-fabric-components
When I use codegen to generate the props from my
MyCustomCompNativeComponent.tsx
, I use the following props:Everything goes as expected - except on the last step, when I actually build the project on Xcode, i get an error in React-Codegen:
No matching function for call to 'fromRawValue'
(check attached screenshot)I think this happens when codegen is trying to generate the props for the native side, and the array of objects in the
actions
prop is not getting converted as expected - which leads me to believe if that's the right way to mention a prop that is an array of objectsI know this is the case because if I comment out / remove that prop, everything works as expected
So it basically boils down to - Am I misunderstanding how to specify a prop of type "array of objects" to codegen?
Version
0.70.2
Output of
npx react-native info
Steps to reproduce
Snack, code example, screenshot, or link to a repository
https://github.com/kalyantm/test-app
The text was updated successfully, but these errors were encountered: