question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Button] Change LoadingButton prop pending to loading

See original GitHub issue

I’m very happy to see the new pre-release v5.0.0-alpha.1. I noticed something:

  • The Autocomplete component has a prop called loading.
  • The LoadingButton component has a prop called pending.

For convention, I think all components should use the word loading. Also it feels it makes sense after the component name

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:22 (17 by maintainers)

github_iconTop GitHub Comments

45reactions
oliviertassinaricommented, Jul 24, 2020

Looking at the semantic, we have:

The use of pending echos back to https://reactjs.org/docs/concurrent-mode-patterns.html#the-three-steps.

I don’t have any strong preference, I think that we can settle this with a vote, the end goal is to make it intuitive to developers.

  • 👍 for loading
  • 🎉 for pending
7reactions
ryancogswellcommented, Jul 11, 2020

@eps1lon Are you arguing for pending only for the prop name or do you also think the component should be called PendingButton? If you are fine with the component name of LoadingButton, why do you feel differently about the prop?

It will always tell if something else is pending. Sometimes this will indicate loading.

In what case is a transition pending when it isn’t because something (code or data) is loading?

It is a special case of a pending transition.

I disagree. I don’t feel like either is broader. “pending” focuses on the state of transition, “loading” refers to why the transition is pending. Why haven’t we transitioned yet? Because we’re still loading something. So the question becomes, is it more intuitive to refer to the transition state or is it more intuitive to refer to the activity that is the cause of the transition state. I would argue that developers will ask, “what is the property I need to set to show that something is still loading?” more readily than asking “what is the property I need to set to indicate that my transition is in a pending state?”

Reusing this terminology for transitions sets the UI up for failure.

In what way does using the term “loading” set the UI up for failure? If someone isn’t aware of the new capabilities provided by concurrent mode in React and how to use them, Material-UI using “pending” for this prop name isn’t going to make them more aware. And if a developer does understand the nuances of concurrent mode, Material-UI using “loading” for this prop name is not going to lead them astray.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Button] Change LoadingButton prop pending to loading #21593
I noticed something: The Autocomplete component has a prop called loading . The LoadingButton component has a prop called pending .
Read more >
LoadingButton API - Material UI - MUI
Rule name Global class Description root.MuiLoadingButton‑root Styles applied to the root element. fullWidth.MuiLoadingButton‑fullWidth Styles applied to the root element if fullWidth= . endIcon.MuiLoadingButton‑endIcon Styles applied to...
Read more >
How can I fix the problem of replacing button text with loading ...
I am using state to maintain the spinner. If data are fetched then the state viewInProgress has a false value. The state is...
Read more >
MUI V5: Button (and the new Loading Button) - YouTube
In this video we go over one of the most used, and simplest Material UI V5 components there is, the Button component! This...
Read more >
React Material UI Tutorial - 39 - Loading Button - YouTube
Courses - https://learn.codevolution.dev/ Support - https://www.paypal.me/Codevolution Github - https://github.com/gopinav⚡️ Checkout ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found