mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: After https://github.com/facebook/react-native/pull/49516 TSC would not find the global types. Types reference expect a package name but was given a path to a declaration. TS doc: https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-path- This PR changes `types` to `path` to fix the issue. `dtslint` fails with `no-bad-reference` rule, but the `../src` lives in the same package in `react-native` package. <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [GENERAL] [FIXED] - Reference `global.d.ts` using `path` so they can be resolved by TSC Pull Request resolved: https://github.com/facebook/react-native/pull/51104 Test Plan: Before the change with current RN 0.79.2 TSC would fail on resolving the global types (example from [Sentry RN SDK build](https://github.com/getsentry/sentry-react-native/commit/134d810cf95416091779806e00d3a3cc6cbace89)):  After the change to path TSC finds the global types. Using TSC Version 4.9.5 Reviewed By: huntie Differential Revision: D74208815 Pulled By: coado fbshipit-source-id: 2fd51d79061ffb356c047604213cff7a425f167e