You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im currently building a React Hooks implementation of the HostedFields method if integration.
With the lifecycle of components, and how React Hooks work, it would be nice to be able to create individual fields and add them to the HostedFields client rather than having to specify them all at one.
The reason being there could be a race condition of the API vs React drawing the dom elements.
Why... The React component needs to be on the page to create the Braintree client and HostedFields but this code lives above the components used to draw the fields. If I could create one field at a time, I could leverage a ref to the container elements and only create the individual fields once the dom was available.
Any thoughts on the best way to use Braintree with a spa?
The text was updated successfully, but these errors were encountered:
Thanks for reaching out with this suggestion. We have discussed implementing an integration pattern similar to the one you are suggesting, though it would most likely require a breaking change a major version bump and we cannot provide a timeline for implementing something like this at this time. I'm going to add the v4 label to this issue and keep this open in case others have this same request.
We don't have any React or SPA specific docs, though there are some third-party implementations out there that you may be able to leverage. Of course let us know if you have any specific questions about your integration and we'll be happy to help. You can also reach out to our support team if you do not want to share specific information about your integration over this public issue => https://developer.paypal.com/braintree/help
Im currently building a React Hooks implementation of the HostedFields method if integration.
With the lifecycle of components, and how React Hooks work, it would be nice to be able to create individual fields and add them to the HostedFields client rather than having to specify them all at one.
The reason being there could be a race condition of the API vs React drawing the dom elements.
Why... The React component needs to be on the page to create the Braintree client and HostedFields but this code lives above the components used to draw the fields. If I could create one field at a time, I could leverage a ref to the container elements and only create the individual fields once the dom was available.
Any thoughts on the best way to use Braintree with a spa?
The text was updated successfully, but these errors were encountered: