Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork149
Closed
Description
In#771 and#774, I changedPlatform.os from an abstract type to a polymorphic variant.
This allows us to use the more convenient
ifPlatform.os===#ios {...}
instead of
ifPlatform.os===Platform.ios {...}
which is fine.
It also allows us to do
switchPlatform.os { |#ios=>... |#android=>... |_=>...}
which is problematic as it compiles to something like
var match = ReactNative.Platform.OS;if (match === "ios") { ...} else if (match === "android") { ...} else { ...}which will break Metro bundler's inlining (see a previous discussion in#239 for more details about this).
So I am not sure anymore if we should introduce a breaking change that invites people to use a problematic pattern. What do you think@MoOx?
Metadata
Metadata
Assignees
Labels
No labels