Commit 2a052d1
Hide src/ directory from TypeScript (react#57277)
Summary:
**Motivation**
Incremental progress towards restricting React Native's internal JavaScript source code.
- `src/private/` was added relatively recently, with very little OSS code depending on it — we can action earlier.
- Helps to reduce the increasingly complicated state of our root `"exports"` map.
**Changes**
Resolve to `null` for the `"types"` package exports condition — this hides from TypeScript suggestions/auto-import.
- **Breaking**: TypeScript's language server will no longer be able to see these modules, and projects will need a `// $TSIgnore` on these imports.
- The ability to access these modules is unchanged: they remain present in the bundle and accessible by Metro.
Changelog:
[General][Breaking] - Deep imports to `'react-native/src/private/...'` have been restricted, and are no longer visible to TypeScript. These subpaths still exist, but do not have type coverage.
Differential Revision: D1090188211 parent 5bdecc6 commit 2a052d1
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
0 commit comments