docs: Update resolverMainFields for vanilla React Native #256
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: #255
What I did
Add "browser" to the
mainResolverFields
, so as not to break polyfills that depend on it.An alternative approach would be to override the default config's
mainResolverFields
, but this requires a much bigger change, that I assume some teams may not be comfortable with. Since the default for pretty much all React Native apps should be the same, I think just adding "browser" is a much less invasive change. If a team has customized theirmainResolverFields
already, then it should be pretty clear what they need to do, when updating theirmetro.config.js
. Just for reference, below is the altnerative solution:How to test
Run through the v6 instructions, everything should still work same as before.