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

105
Visualizações
useState how to set the initial long value

There is a very large state that I get from json, that consists of at least 50 lines.

When generating the page, it gives the error "there is no such value" if you do not set the value initially and assign the interface

const [dataPosibleValue, setDataPosibleValue]:[IStatPokemon,Dispatch<SetStateAction<IStatPokemon>>] = useState('')

Is it possible not to set the value at the beginning so that there is no error during generation?

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

0

You can only set it, if you have it. If you have it you can set it by passing it into the function like so:

const [dataPosibleValue, setDataPosibleValue]:[IStatPokemon,Dispatch<SetStateAction>] 
  = useState('your initial long value')
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