score:0

you can manipulate the state of the notification in the state of the component that have all pages routes, for example:

const [needsnotification, setneedsnotification] = usestate('true');


<switch>
  <route
    path={'/home'}
    render={<home props={...props, needsnotification}} />
  />
  <route
    path={'/another-page'}
    render={<anotherpage props={...props, setneedsnotification} />}
  />
<switch/>

in the anotherpage component you use the function props.setneedsnotification(false) when it mounts and in the home page you create a condition that the warning is only shown if needsnotification === true.


Related Query

More Query from same tag