Skip to content

Conversation

hosseinmd
Copy link
Contributor

Specially in react-native repack, we need to resolve from source code

@TkDodo
Copy link
Collaborator

TkDodo commented Dec 27, 2024

I have never seen a top-level react-native field in package.json, and a quick google search also didn't yield any good results. Can you please elaborate what this does, which bundlers interpret this field and why we need it? Thanks.

@hosseinmd
Copy link
Contributor Author

hosseinmd commented Dec 27, 2024

Look at these libraries:
React-navigation
React-freeze
react-native-video
react-native-gesture-handler
cross-fetch
lottie-react-native

And so many libraries which wanna work with platform specific files ('.native.ts' or '.android.ts') should be considered this.
Without specifying source for react-native loaders for handling tree shaking will load module and then import react-dom in react-native

@hosseinmd
Copy link
Contributor Author

@TkDodo TkDodo merged commit 7ade233 into TanStack:main Dec 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants