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

Create Individual Fields #604

Open
mattsputnikdigital opened this issue Nov 22, 2021 · 2 comments
Open

Create Individual Fields #604

mattsputnikdigital opened this issue Nov 22, 2021 · 2 comments
Labels
v4 Issues that require a major version bump to resolve

Comments

@mattsputnikdigital
Copy link

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?

@jplukarski
Copy link
Contributor

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

@jplukarski jplukarski added the v4 Issues that require a major version bump to resolve label Dec 1, 2021
@bufordtaylor
Copy link

Half the internet uses React. Some docs would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v4 Issues that require a major version bump to resolve
Projects
None yet
Development

No branches or pull requests

3 participants