Relative Content

Tag Archive for javascriptreactjsreact-router-dom

How to pass data from a page to another page using react router

Please I need help on react-router-dom, I am new to the library and can seem to find any solution since. I am getting three results from an api call, in which I map over the data to render it on UI, now what I need now is that if I click on a row on one of this list, I want it to take me to a screen showing the details of only that single thing I clicked on.

React js Nested route forces useEffect with empty array ([]) to rerun after it has been mounted

useEffect(() => { dispatch(getAllPatients()); }, [dispatch]); <Row> <Col xs={12} lg={3} style={{ paddingRight: ‘0’, width: ‘${barWidth}px’ }} className=’position-relative toggle-patient-bar ps-0′ > <PatientSidebar setBarWidth={setBarWidth} /> </Col> <Switch> <Route render={() => <PatientData barWidth={barWidth} />} exact path={‘/patient/:id’} strict /> </Switch> </Row> I have this parent page with nested routing. The problem is when I click on patient to open […]