8000 Default JS Dispatcher for React Native is wrong · Issue #2843 · Kotlin/kotlinx.coroutines · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Default JS Dispatcher for React Native is wrong #2843
Closed
@Legion2

Description

@Legion2

As part of ecc68f1 the Default dispatcher for React Native was set to NodeDispatcher. However, there is no process.nextTick in React Native environments. There is only a fake process.env object but nothing else. As a result the Default dispatcher does not work in React Native.

So I tested the other dispatchers. In React Native environments the SetTimeoutDispatcher works well. If React Native is executed with a Debugger (Chrome) the JS code is executed in a Chrome worker. In this mode SetTimeoutDispatcher and window.asCoroutineDispatcher() can be used as dispatchers, NodeDispatcher does not work.

To resolve this issue, createDefaultDispatcher must be adapted, so it properly detects the fake process object without the nextTick function.

If needed I can provide a PR and test changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0