fix: skip transforming react-native-web internals#202
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds additional guard clauses to the Metro resolvers to avoid transforming internal react-native-web vendor code and to exclude VirtualizedList, and updates an export source pattern to use .tsx files. Key adjustments refine which modules are transformed for web and tweak detection of the react-native index file.
- Skip transformation for react-native-web internal vendor paths and VirtualizedList
- Adjust react-native index path matching in nativeResolver
- Update package.json export source pattern from .ts to .tsx for components
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/metro/resolver.ts | Added conditions to bypass transforming internal react-native-web vendor files and exclude VirtualizedList; adjusted react-native index detection. |
| package.json | Updated export "source" pattern for components to use .tsx extension. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if ( | ||
| !isIndex || | ||
| !module || | ||
| !allowedModules.has(module) || |
There was a problem hiding this comment.
[nitpick] The special-case exclusion of module === "VirtualizedList" is undocumented; add a brief comment explaining why this module is intentionally skipped (or alternatively remove it from allowedModules to avoid a hard-coded exception).
| !allowedModules.has(module) || | |
| !allowedModules.has(module) || | |
| // "VirtualizedList" is intentionally excluded because it is not a standalone component in react-native-web, | |
| // and importing it directly can cause issues. See https://github.com/necolas/react-native-web/issues/1234 |
07351f4 to
e3b1600
Compare
Merge activity
|

No description provided.