cyntler / cyntler/react-doc-viewer

Problem specifying the prefetchMethod

Open
#168 3 comments 0 reactions 1 assignee Claimed by @cyntler View on GitHub
bug
Dominant language
TypeScript
Stars
481
Forks
147
PR merge metrics
No merged PRs in 30d

Description

Hi, I think the line below is missing some parentheses. It seems to be calling `GET` when anything truthy is provided in the property.

https://github.com/cyntler/react-doc-viewer/blob/b58b9494c7d04e8084ff44b29e71c129398483ee/src/hooks/useDocumentLoader.ts#L42

I think it's interpreting the line as:
`(prefetchMethod || documentURI.startsWith("blob:")) ? "GET" : "HEAD",`
rather than:
`prefetchMethod || (documentURI.startsWith("blob:") ? "GET" : "HEAD"),`
I think specifying the latter would fix it.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.