Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
How to implement MUI skeleton on API response data?

I am using material-ui skeleton (Shimmer effect) on data which is coming from API.

{
accountData.usersAccountData.map((userData, index) => (
// ...UI code
)
)
}

Output is given below :
output
As you can see, I received 3 objects from API. So accountData.usersAccountData.map will run 3 times.
My question is, How can I implement mui skeleton while API is under process ?
How can show shimmer effect while API is under process ?

NOTE :
I have tried <Skeleton ...otherParams /> inside accountData.usersAccountData.map but this didn't work because accountData.usersAccountData length is zero while API is under process.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

So you need to implement isAPILoading for skeleton before your main UI render like this

if (isAPILoading) {
  return <Skeleton ...otherParams />;
}

return (
   {
     accountData.usersAccountData.map((userData, index) => (
    // ...UI code
    )
   )
  }
    )

but you need to also check for whether your response is success or fail if success you can show your UI else you can show error for the same.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda