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

using Preload component on its own #62

Open
dreyks opened this issue Dec 13, 2018 · 0 comments · May be fixed by #65
Open

using Preload component on its own #62

dreyks opened this issue Dec 13, 2018 · 0 comments · May be fixed by #65

Comments

@dreyks
Copy link

dreyks commented Dec 13, 2018

I have a several-step form which sometimes includes stripe. I'm already using a Script and it works. But now I want to Preload stripe javascript on the first step if I know for sure that second step will include stripe
So I'm doing

<React.Suspense>
  <Preload href="https://js.stripe.com/v3/" rel="preload" as="script" />
</React.Suspense>

which fails, since Preload renders children which are undefined. And I have to write <Preload href="https://js.stripe.com/v3/" rel="preload" as="script">{null}</Preload>.
So maybe change this line https://github.com/palmerhq/the-platform/blob/2e24147c26124f65519a69e73d17bcc8c61c2d91/src/Preload.tsx#L34 into return children || null?

@dreyks dreyks linked a pull request Dec 29, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant