Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Revert the Platform.os changes? #778

Closed
@cknitt

Description

@cknitt

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp