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

210
Visualizações
Uncaught Error: Maximum update depth exceeded react hooks

I am working with hooks. This is my component with react-number-format

const [startDuration, setStartDuration] = useState(0)
const [streamDetail, setStreamDetail] = useState({})
const onChangeStartDuration = ({ formattedValue }) => {
    setStartDuration(formattedValue);
}




 const function1 = async () => {
    const { value } = await getVideos({
      id
    })

  const [state, setState] = useState({
    videoUrl: 0,
    videoThumbnailUrl: 0,
    player: false,
    startTime: 0,
    endTime: 0,
    serverAddress: "",
    title: "",
    liveVideoUrl: "",
  })

    if (value.success) {
      setStreamDetail(value.stream)
      setState({ ...state, liveVideoUrl: value.stream.url, serverAddress: value.stream.server_address })
    }
  }
useEffect(() => {
    myfunction1()
  }, [])
  useEffect(() => {
    if (window.jwplayer) {
      setFunc(window.jwplayer("xxxxxx"))
    }
  }, [window.jwplayer, state.liveVideoUrl]);

return (
  <div className="">
    <div className="">
      <button
        className="btn-s-one fill"
        onClick={() => {
          setStartDuration(func.getPosition());
        }}
      >
        Start Cut
      </button>
    </div>
    <div className="">
      <div className="">
        <div className="">
          <div className="">
            <label>Start Cut</label>
            <NumberFormat
              type="text"
              format="## : ## : ##"
              value={conevetIntoHMS(startDuration)}
              onValueChange={onChangeStartDuration}
            />
          </div>
        </div>
      </div>
    </div>
  </div>
);

What is happening here is when I am clicking on the "Start Cut" button it just throws error for continuously updating state. Not sure what is going. Any help would be much appreciated. thanks

about 4 years ago · Juan Pablo Isaza
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