verygoodsecurity / collect-js-react

MIT License
1 stars 15 forks source link

expose unmount in ref #37

Closed steven-brand-dd closed 1 year ago

steven-brand-dd commented 1 year ago

Description

This PR exposes the VGS unmount function through a react ref.

Motivation and Context

There is existing logic where the VGS form will call unmount when the Form is unmounted from the DOM. However, this function may not always be available if the form is conditionally render (ie. in a modal). This is b/c the component is removed from the DOM before the unmount function can be called.

How Has This Been Tested?

Screenshots (if appropriate):

Types of Changes

Checklist: