Skip to content
Discussion options

You must be logged in to vote

I disable a lot of buttons on SSR, this is how I do it @MarArMar:

<button
 disabled={!browser || !stripe}
 on:Click={doSomething}>
  Buy!
  {#if !browser || !stripe}
    <!-- show loader -->
  {/if}
</button>

I style it, too.. Change the color / opacity when it's disabled.

This loads the button in a "loading" state to users, but when the browser has taken over and even third party tools (like stripe.js) fully load - it's ready to go.

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@dummdidumm
Comment options

@MarArMar
Comment options

@MarArMar
Comment options

@TkDodo
Comment options

@MarArMar
Comment options

Comment options

You must be logged in to vote
1 reply
@MarArMar
Comment options

Answer selected by MarArMar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #11835 on February 13, 2024 10:15.