Skip to content

[0.79] Exclude selectively disabled libraries from codegen generation #921

@cipolleschi

Description

@cipolleschi

Target Branch(es)

0.79

Link to commit or PR to be picked

facebook/react-native@be8595b

Description

Selectively disabling autolinking of a native dependency with components registered in the codegen configuration in react-native.config.js causes builds to crash upon launch on iOS. This is because the generated RCTThirdPartyComponentsProvider.mm file contains references to the excluded library using NSClassFromString causing the returned NSDictionary from +[RCTThirdPartyComponentsProvider thirdPartyFabricComponents] to be populated with nil values and therefore crashing the app. This has been confirmed in 0.78.2 and 0.79.2 but probably exists in 0.77.x as well.

This is a fix for an edge case when user manually disable libraries from autolinking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type Pick RequestPick requests to include commits inside a React Native release

    Type

    No type

    Projects

    Status

    Done / Picked

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions