Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!