paypal / paypal-js

Loading wrapper and TypeScript types for the PayPal JS SDK
Apache License 2.0
238 stars 83 forks source link

[Bug] Typescript warning: `resetOptions` cannot be used in dispatch type #530

Closed TheMikeyRoss closed 1 month ago

TheMikeyRoss commented 5 months ago

Library used

react-paypal-js

🐞 Describe the Bug

Typescript warning that resetOptions cannot be used as a dispatch type

image

🔬 Minimal Reproduction

Describe steps to reproduce. If possible, please, share a link with a minimal reproduction.

😕 Actual Behavior

A clear and concise description of what is happening. Please include console logs during the time of the issue, especially error messages.

🤔 Expected Behavior

A clear and concise description of what you expected to happen.

🌍 Environment

➕ Additional Context

Add any other context about the problem here.

wsbrunson commented 4 months ago

This may be because we are using TypeScript's enum feature for those values.

Try using this:

import { DISPATCH_ACTION } from "@paypal/react-paypal-js";
...
dispatch({type: DISPATCH_ACTION.RESET_OPTIONS, ... })
github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] commented 1 month ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information.