Skip to content

[JS] Remove the global document variable #1473

@oveddan

Description

@oveddan

Having a global document variable without implementing all of its methods causes interop issues with other libraries that expect the global document to have those methods, if it exists.

This occurs, for example, when trying to require jquery, and it sees a global document and attempts to call createElement on it. Use case and explaination of issue can be seen here.

According to @vjeux

There is no good reason for react-native to have a global document variable with just a single key createElement: null. We need to remove document altogether, it was added as a workaround very early in the project and is not needed anymore.

Therefore it seems the best solution would be to not attach the react-native specific document to global.

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