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

230
Visualizações
Updating state will cause re-rendering and it will close Material UI Dialog Box

so I'm using Material Ui Fullscreen Dialog and everytime a state change, it will re-render and close the dialog box. what should i do? how can i collect data from this dialog box ? I'm using Context API to update parent state.

  const [advancedSearch, setAdvancedSearch] = useState({
    selectIdentify: "",
    type: "",
    gender: "",
    age: { from: "", to: "" },
    registerDate: { from: "", to: "" },
    and etc... (there are so many input field)
  });
  <Dialog
          fullScreen
          open={open}
          onClose={handleClose}
          TransitionComponent={Transition}
        >
          <AppBar>
            <Toolbar>
              <IconButton
                edge="start"
                onClick={handleClose}
              >
                <CloseIcon />
              </IconButton>
              <Typography
                component="div"
              >
                Advanced Search
              </Typography>
              <Button
                startIcon={<SearchIcon />}
              >
                Create New Form
              </Button>
              <Button
                startIcon={<SearchIcon />}
                onClick={handleClose}
              >
                Search
              </Button>
            </Toolbar>
          </AppBar>
          <div>
            <AdvancedSearchContext.Provider
              value={{ advancedSearch, setAdvancedSearch }}
            >
              <Form1 />
              <Form2 />
              <Form3 /> 
            </AdvancedSearchContext.Provider>
          </div>
        </Dialog>

i know one solution is to have state in the three Form1,2,3 Children but in that case how should I collect it in the parent and send the data ?

about 4 years ago · Santiago Gelvez
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