react-native icon indicating copy to clipboard operation
react-native copied to clipboard

No matching function for call to 'fromRawValue'

Open kalyantm opened this issue 3 years ago • 8 comments

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:

export interface NativeProps extends ViewProps {
  text: string;
  title: string;
  actions: ReadonlyArray<Readonly<{id: string; actionName: string}>>;
}

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 objects

I 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

    OS: macOS 12.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 228.14 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.17.0 - /usr/local/bin/node
    Yarn: 1.22.18 - /opt/local/bin/yarn
    npm: 7.0.15 - ~/.nvm/versions/node/v15.4.0/bin/npm
    Watchman: 2022.10.03.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      Android NDK: 24.0.8215888
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8309675
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0
    react-native: 0.70.2 => 0.70.2
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

Snack, code example, screenshot, or link to a repository

https://github.com/kalyantm/test-app

kalyantm avatar Oct 22 '22 18:10 kalyantm

So it basically boils down to - Am I misunderstanding how to specify a prop of type "array of objects" to codegen?

cc @cipolleschi

cortinico avatar Oct 24 '22 17:10 cortinico

Hi @kalyantm! The solution to this should be to create a named type for the <action, id> object.

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 avatar Oct 24 '22 19:10 cipolleschi

@cipolleschi Nope, did not work, i get an error when i run RCT_NEW_ARCH_ENABLED=1 arch=-x86_64 npx pod-install

/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238
      throw new Error(`Unknown prop type for "${name}": ${type}`);
      ^

Error: Unknown prop type for "actions": TSInterfaceDeclaration
    at getTypeAnnotationForArray (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238:13)
    at getTypeAnnotation (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:278:20)
    at buildPropSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:585:21)
    at /Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:638:14
    at Array.map (<anonymous>)
    at getProps (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:637:6)
    at buildComponentSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/index.js:237:17)
    at buildSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:146:34)
    at Object.parseFile (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:185:10)
    at files.reduce.modules (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema.js:76:30)
Error: Command failed: node /Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js /var/folders/r1/cf_8l8n95sn_0p7fsswk4fww0000gn/T/RNMenuSpecs1zfbvv/schema.json /Users/kalyantm/menu-app/MenuApp/node_modules/rn-menu/js
/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238
      throw new Error(`Unknown prop type for "${name}": ${type}`);
      ^

Error: Unknown prop type for "actions": TSInterfaceDeclaration
    at getTypeAnnotationForArray (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238:13)
    at getTypeAnnotation (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:278:20)
    at buildPropSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:585:21)
    at /Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:638:14
    at Array.map (<anonymous>)
    at getProps (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:637:6)
    at buildComponentSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/index.js:237:17)
    at buildSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:146:34)
    at Object.parseFile (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:185:10)
    at files.reduce.modules (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema.js:76:30)

    at checkExecSyncError (node:child_process:841:11)
    at execSync (node:child_process:912:15)
    at executeNodeScript (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:38:3)
    at generateSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:314:3)
    at /Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:373:26
    at Array.forEach (<anonymous>)
    at generateNativeCodegenFiles (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:362:13)
    at Object.execute (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:532:5)
    at Object.<anonymous> (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/generate-artifacts.js:64:10) {
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer >,
    <Buffer 2f 55 73 65 72 73 2f 6b 61 6c 79 61 6e 74 6d 2f 6d 65 6e 75 2d 61 70 70 2f 4d 65 6e 75 41 70 70 2f 6e 6f 64 65 5f 6d 6f 64 75 6c 65 73 2f 72 65 61 63 ... 1479 more bytes>
  ],
  pid: 64913,
  stdout: <Buffer >,
  stderr: <Buffer 2f 55 73 65 72 73 2f 6b 61 6c 79 61 6e 74 6d 2f 6d 65 6e 75 2d 61 70 70 2f 4d 65 6e 75 41 70 70 2f 6e 6f 64 65 5f 6d 6f 64 75 6c 65 73 2f 72 65 61 63 ... 1479 more bytes>
}
.

 #  from /Users/kalyantm/menu-app/MenuApp/ios/Podfile:13
 #  -------------------------------------------
 #
 >    use_react_native!(
 #      :path => config[:reactNativePath],
 #  -------------------------------------------
Couldn't install Pods. Updating the Pods project and trying again...
> pod install --repo-update
Auto-linking React Native module for target `MenuApp`: rn-menu
[Codegen] Adding script_phases to React-Codegen.
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json

[!] Invalid `Podfile` file: [!] /usr/local/bin/node ./../node_modules/react-native/scripts/generate-artifacts.js -p /Users/kalyantm/menu-app/MenuApp/ios/.. -o /Users/kalyantm/menu-app/MenuApp/ios -e true -c

[Codegen] Processing react-native core libraries
[Codegen] Found react-native


[Codegen] >>>>> Searching for codegen-enabled libraries in /Users/kalyantm/menu-app/MenuApp/node_modules
[Codegen] Found rn-menu


[Codegen] >>>>> Searching for codegen-enabled libraries in react-native.config.js


[Codegen] >>>>> Searching for codegen-enabled libraries in the app


[Codegen] >>>>> Processing FBReactNativeSpec
[Codegen] Generated schema: /var/folders/r1/cf_8l8n95sn_0p7fsswk4fww0000gn/T/FBReactNativeSpecAqWwh7/schema.json
[Codegen] Generated artifacts: /Users/kalyantm/menu-app/MenuApp/ios/build/generated/ios


[Codegen] >>>>> Processing rncore
[Codegen] Generated schema: /var/folders/r1/cf_8l8n95sn_0p7fsswk4fww0000gn/T/rncorehLX969/schema.json
[Codegen] Generated artifacts: /Users/kalyantm/menu-app/MenuApp/ios/build/generated/ios


[Codegen] >>>>> Processing RNMenuSpecs


[Codegen] Done.
/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238
      throw new Error(`Unknown prop type for "${name}": ${type}`);
      ^

Error: Unknown prop type for "actions": TSInterfaceDeclaration
    at getTypeAnnotationForArray (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238:13)
    at getTypeAnnotation (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:278:20)
    at buildPropSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:585:21)
    at /Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:638:14
    at Array.map (<anonymous>)
    at getProps (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:637:6)
    at buildComponentSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/index.js:237:17)
    at buildSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:146:34)
    at Object.parseFile (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:185:10)
    at files.reduce.modules (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema.js:76:30)
Error: Command failed: node /Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js /var/folders/r1/cf_8l8n95sn_0p7fsswk4fww0000gn/T/RNMenuSpecsyryKQh/schema.json /Users/kalyantm/menu-app/MenuApp/node_modules/rn-menu/js
/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238
      throw new Error(`Unknown prop type for "${name}": ${type}`);
      ^

Error: Unknown prop type for "actions": TSInterfaceDeclaration
    at getTypeAnnotationForArray (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238:13)
    at getTypeAnnotation (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:278:20)
    at buildPropSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:585:21)
    at /Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:638:14
    at Array.map (<anonymous>)
    at getProps (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:637:6)
    at buildComponentSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/index.js:237:17)
    at buildSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:146:34)
    at Object.parseFile (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:185:10)
    at files.reduce.modules (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema.js:76:30)

    at checkExecSyncError (node:child_process:841:11)
    at execSync (node:child_process:912:15)
    at executeNodeScript (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:38:3)
    at generateSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:314:3)
    at /Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:373:26
    at Array.forEach (<anonymous>)
    at generateNativeCodegenFiles (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:362:13)
    at Object.execute (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:532:5)
    at Object.<anonymous> (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/generate-artifacts.js:64:10) {
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer >,
    <Buffer 2f 55 73 65 72 73 2f 6b 61 6c 79 61 6e 74 6d 2f 6d 65 6e 75 2d 61 70 70 2f 4d 65 6e 75 41 70 70 2f 6e 6f 64 65 5f 6d 6f 64 75 6c 65 73 2f 72 65 61 63 ... 1479 more bytes>
  ],
  pid: 64946,
  stdout: <Buffer >,
  stderr: <Buffer 2f 55 73 65 72 73 2f 6b 61 6c 79 61 6e 74 6d 2f 6d 65 6e 75 2d 61 70 70 2f 4d 65 6e 75 41 70 70 2f 6e 6f 64 65 5f 6d 6f 64 75 6c 65 73 2f 72 65 61 63 ... 1479 more bytes>
}
.

 #  from /Users/kalyantm/menu-app/MenuApp/ios/Podfile:13
 #  -------------------------------------------
 #
 >    use_react_native!(
 #      :path => config[:reactNativePath],
 #  -------------------------------------------
Couldn't install Pods. Updating the Pods project and trying again...
Command `pod install` failed.
└─ Cause: Invalid `Podfile` file: [!] /usr/local/bin/node ./../node_modules/react-native/scripts/generate-artifacts.js -p /Users/kalyantm/menu-app/MenuApp/ios/.. -o /Users/kalyantm/menu-app/MenuApp/ios -e true -c

[Codegen] Processing react-native core libraries
[Codegen] Found react-native


[Codegen] >>>>> Searching for codegen-enabled libraries in /Users/kalyantm/menu-app/MenuApp/node_modules
[Codegen] Found rn-menu


[Codegen] >>>>> Searching for codegen-enabled libraries in react-native.config.js


[Codegen] >>>>> Searching for codegen-enabled libraries in the app


[Codegen] >>>>> Processing FBReactNativeSpec
[Codegen] Generated schema: /var/folders/r1/cf_8l8n95sn_0p7fsswk4fww0000gn/T/FBReactNativeSpecAqWwh7/schema.json
[Codegen] Generated artifacts: /Users/kalyantm/menu-app/MenuApp/ios/build/generated/ios


[Codegen] >>>>> Processing rncore
[Codegen] Generated schema: /var/folders/r1/cf_8l8n95sn_0p7fsswk4fww0000gn/T/rncorehLX969/schema.json
[Codegen] Generated artifacts: /Users/kalyantm/menu-app/MenuApp/ios/build/generated/ios


[Codegen] >>>>> Processing RNMenuSpecs


[Codegen] Done.
/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238
      throw new Error(`Unknown prop type for "${name}": ${type}`);
      ^

Error: Unknown prop type for "actions": TSInterfaceDeclaration
    at getTypeAnnotationForArray (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238:13)
    at getTypeAnnotation (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:278:20)
    at buildPropSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:585:21)
    at /Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:638:14
    at Array.map (<anonymous>)
    at getProps (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:637:6)
    at buildComponentSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/index.js:237:17)
    at buildSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:146:34)
    at Object.parseFile (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:185:10)
    at files.reduce.modules (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema.js:76:30)
Error: Command failed: node /Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js /var/folders/r1/cf_8l8n95sn_0p7fsswk4fww0000gn/T/RNMenuSpecsyryKQh/schema.json /Users/kalyantm/menu-app/MenuApp/node_modules/rn-menu/js
/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238
      throw new Error(`Unknown prop type for "${name}": ${type}`);
      ^

Error: Unknown prop type for "actions": TSInterfaceDeclaration
    at getTypeAnnotationForArray (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:238:13)
    at getTypeAnnotation (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:278:20)
    at buildPropSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:585:21)
    at /Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:638:14
    at Array.map (<anonymous>)
    at getProps (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/props.js:637:6)
    at buildComponentSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/components/index.js:237:17)
    at buildSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:146:34)
    at Object.parseFile (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/parsers/typescript/index.js:185:10)
    at files.reduce.modules (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema.js:76:30)

    at checkExecSyncError (node:child_process:841:11)
    at execSync (node:child_process:912:15)
    at executeNodeScript (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:38:3)
    at generateSchema (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:314:3)
    at /Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:373:26
    at Array.forEach (<anonymous>)
    at generateNativeCodegenFiles (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:362:13)
    at Object.execute (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:532:5)
    at Object.<anonymous> (/Users/kalyantm/menu-app/MenuApp/node_modules/react-native/scripts/generate-artifacts.js:64:10) {
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer >,
    <Buffer 2f 55 73 65 72 73 2f 6b 61 6c 79 61 6e 74 6d 2f 6d 65 6e 75 2d 61 70 70 2f 4d 65 6e 75 41 70 70 2f 6e 6f 64 65 5f 6d 6f 64 75 6c 65 73 2f 72 65 61 63 ... 1479 more bytes>
  ],
  pid: 64946,
  stdout: <Buffer >,
  stderr: <Buffer 2f 55 73 65 72 73 2f 6b 61 6c 79 61 6e 74 6d 2f 6d 65 6e 75 2d 61 70 70 2f 4d 65 6e 75 41 70 70 2f 6e 6f 64 65 5f 6d 6f 64 75 6c 65 73 2f 72 65 61 63 ... 1479 more bytes>
}
.

 #  from /Users/kalyantm/menu-app/MenuApp/ios/Podfile:13
 #  -------------------------------------------
 #
 >    use_react_native!(
 #      :path => config[:reactNativePath],
 #  -------------------------------------------

kalyantm avatar Oct 25 '22 05:10 kalyantm

@cipolleschi However, it does build if I define it like this:

type Action = Readonly<{
  identifier: string;
  title: string;
}>;

export interface NativeProps extends ViewProps {
  // other props
  actions?: ReadonlyArray<Action>;
}

But this again, leads to the same error in XCode:

Screenshot 2022-10-25 at 10 50 35 AM

kalyantm avatar Oct 25 '22 05:10 kalyantm

Hum... That's weird, this should actually work. I'll try to have a look at it today. Thank you for providing the sample repo!

cipolleschi avatar Oct 25 '22 07:10 cipolleschi

I think I found the problem, @kalyantm. I think that the codegen is missing this header: #include <react/renderer/core/propsConversions.h> when it generates those nested structures. When I add it, it builds.

Could you try to add that header to the Props.h file in the React-Codegen/react/renderer/components/RNMenuSpecs Development Pods and see if it works at runtime too (I don't have an app set up to work with this component)?

If we confirm that this is the problem, we can fix it in the Codegen for everyone! Thank you so much!

cipolleschi avatar Oct 25 '22 08:10 cipolleschi

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 avatar Oct 25 '22 09:10 cipolleschi

@cipolleschi Yup, including that header fixed it for me!

kalyantm avatar Oct 25 '22 09:10 kalyantm

@cipolleschi Is this merged in? I still have to manually add this in everytime I build 😅

kalyantm avatar Jan 25 '23 13:01 kalyantm

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.

cipolleschi avatar Jan 25 '23 16:01 cipolleschi

This commit https://github.com/facebook/react-native/commit/a00cea46bf0bde788e6f92ae8f750bd9e32a2739 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.

cipolleschi avatar Jan 30 '23 10:01 cipolleschi

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.

github-actions[bot] avatar Jul 30 '23 05:07 github-actions[bot]

Fix shipped in 0.72

cipolleschi avatar Jul 30 '23 10:07 cipolleschi