SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Use more accurate type in LinkingManager spec file (#45450)

Summary:
The `LinkingModule.getInitialURL` method is declared as returning a `Proimise<string>` but looking at the implementation it can also return null:

https://github.com/facebook/react-native/blob/a96272e27eeee0c7a26e73bb32e55d3ef8d741aa/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm#L166
which is returned by
https://github.com/facebook/react-native/blob/a96272e27eeee0c7a26e73bb32e55d3ef8d741aa/packages/react-native/Libraries/Linking/Linking.js#L96
which happens to expand the type to the correct type for most external users.

React-native-window's turbomodule codegen is more type strict, and so cannot return null with the current spec.

## Changelog:

[INTERNAL] [FIXED] - Use more accurate type in LinkingManager spec file

Pull Request resolved: https://github.com/facebook/react-native/pull/45450

Test Plan:
Type change only, so should only affect build time change which will be caught by CI.
Have verified that this type change allows react-native-windows to return null.

Reviewed By: robhogan

Differential Revision: D59816089

Pulled By: zeyap

fbshipit-source-id: 9810f150ce84b503883e72b1f29518d2e62258b6
A
Andrew Coates committed
892c8352cae25db8e5b5df27451e1bc0290a9558
Parent: c085180
Committed by Facebook GitHub Bot <[email protected]> on 7/16/2024, 8:41:48 PM