score:1

Accepted answer

you can create a new <route/> on the /app. you can pass the props down to map as needed.

<route
    path='/map'
    render={(props) =>
        <map
            {...props}
            coords={this.state.coords}
        />
    }
/>

since you are on the home component, you probably need to pass a function from app down to home via prop so you can update the, for example, coords state on the app which you will be passing as prop down to map. example code on app:

updatecoords = (val) => {
    this.setstate({
        coords: val
    })
}

<route
    path='/home'
    render={(props) =>
        <home
            {...props}
            updatecoords={this.updatecoords}
        />
    }
/>

then on home simply call this.props.updatecoords(somevalue) to update the state of the coords state on your app.

if you need to redirect right away i suggest using the <link> (https://reactrouter.com/web/api/link) or use history api on app

this.props.history.push(`/${someroute}`);

Related Query

More Query from same tag