0

I'm using react router v4. I have navbar in it. it has one dropdown clicking on it it navigates to one page. I'm passing it's as URL parameter but I want it's name on my next page as well. Any idea how to add that one? my routes re like this.

ReactDOM.render(
  <Provider store={store}>
     <BrowserRouter >
      <div>
        <HeaderContainer/>
          <Route path="/program/:program_id" component={ProgramContainer}/>   
      </div>
    </BrowserRouter>
  </Provider>, document.getElementById('root')
);

I tried like this way:

Details(Name){
        console.log("prog name",Name)
        this.setState(() => {
            name:Name
        })
    }

This is how I am populating menu in nav:

  {program.map((prog) => 
                            <LinkContainer key={prog.pk} to={program_data_url+prog.pk}>
                               <MenuItem  key={prog.pk} onClick={()=>this.programDetails(prog.name)} >{prog.name}
                              </MenuItem> 
                              </LinkContainer>
                            )}
2
  • Your question is not clear to me. Do you mind explaining it a little bit better Commented Aug 2, 2017 at 11:10
  • ok..I have one drop down. it has 2 params. id and name clcking on it ,it passes id to <LinkContainer> of react-bootstrap and load one react component. I show that componenets params it doesn't have name but I need that name in my componenet
    – LowCool
    Commented Aug 2, 2017 at 11:26

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.