score:1

Accepted answer
const { state } = useLocation();
const { showFlag } = state; // use showFlag the way you want.

Related Query

More Query from same tag