Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: react-native don't support global and Document #115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GrinZero
Copy link

Issue

React Native was unable to successfully integrate with the SDK due to a lack of platform compatibility code when writing the base SDK.

Link

@@ -106,7 +106,7 @@ export function isHeaders(value: unknown): value is Headers {
}

export function isDocument(value: unknown): value is Document {
return value instanceof Document;
return typeof globalThis.Document !== 'undefined' && value instanceof globalThis.Document;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

理论上这个函数不应该被 rn 打包进来,这个bug 会另外修掉。
不过这里 typeof 一下也没问题

qkang07 added a commit that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants