Accepted answer

for dynamic routes.. you can use something like..

{ path: "/projects/:subproject", name: 'subproject', component: subproject},

and you can invoke this route by history.push("/projects" + this.state.clickedsubprojectname)

export const clickedsubprojectname={
      clickedsubprojectname: this.state.clickedsubprojectname}

this definitely won't work.. this variable gets exported once and imported once. so it will always return the default value.

Related Query

More Query from same tag