Repository: react-native
Issue: [0.76][iOS][Codegen] Fabric Native Component from website has a bug
Labels: Platform: iOS,Resolution: PR Submitted

### Description

Currently [codegen](https://reactnative.dev/docs/next/fabric-native-components-introduction#1-run-codegen) generates `RCTThirdPartyFabricComponents` wrappers with references to the Fabric Components.  If these components are inlined in your application, they fail to build (as the they're linked in the Pods and not the App, so can't find the symbols).  You'll see an error similar to this (except your component class will be missing):

```stacktrace
Undefined symbols for architecture arm64:
  "_CustomWebViewCls", referenced from:
      _RCTThirdPartyFabricComponentsProvider in libReact-RCTFabric.a[41](RCTThirdPartyFabricComponentsProvider.o)
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```

We're expecting a fix to ship in 0.76.1 (#47176), but leaving this issue here as a placeholder until that's the case.

## Appendix:
See commented out lines, which you'll have to do until the fix ships.

```objc title="./node_modules/react-native/React/Fabric/RCTThirdPartyFabricComponentsProvider.mm"

/*
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by GenerateRCTThirdPartyFabricComponentsProviderH
 */

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"

#import <React/RCTComponentViewProtocol.h>

#ifdef __cplusplus
extern "C" {
#endif

Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name);
#if RCT_NEW_ARCH_ENABLED
#ifndef RCT_DYNAMIC_FRAMEWORKS

//Class<RCTComponentViewProtocol> CustomWebViewCls(void) __attribute__((used)); // 0

#endif
#endif

#ifdef __cplusplus
}
#endif

#pragma GCC diagnostic pop
```
and

```objc title="./node_modules/react-native/React/Fabric/RCTThirdPartyFabricComponentsProvider.h"

/**
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by GenerateRCTThirdPartyFabricComponentsProviderCpp
 */

// OSS-compatibility layer

#import "RCTThirdPartyFabricComponentsProvider.h"

#import <string>
#import <unordered_map>

Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name) {
  static std::unordered_map<std::string, Class (*)(void)> sFabricComponentsClassMap = {
    #if RCT_NEW_ARCH_ENABLED
    #ifndef RCT_DYNAMIC_FRAMEWORKS

//    {"CustomWebView", CustomWebViewCls}, // 0
    #endif
    #endif
  };

  auto p = sFabricComponentsClassMap.find(name);
  if (p != sFabricComponentsClassMap.end()) {
    auto classFunc = p->second;
    return classFunc();
  }
  return nil;
}

```

### Steps to reproduce

N/A

### React Native Version

0.76.0

### Affected Platforms

Runtime - iOS, Build - MacOS

### Output of `npx react-native info`

```text
N/A
```


### Stacktrace or Logs

```text
N/A
```


### Reproducer

https://github.com/cipolleschi/InAppComponent

### Screenshots and Videos

![CleanShot 2024-10-23 at 08 59 15@2x](https://github.com/user-attachments/assets/9dd8d8ff-48b8-49e9-b209-2f08e6d8e222)