Routing to specific part of other component in React

后端 未结 3 606
一向
一向 2021-01-27 18:14

I have a problem with routing to a specific part of another functional component in React. I have declared Route in Main component and Link around the place where I want to redi

3条回答
  •  情书的邮戳
    2021-01-27 18:39

    You need only one route like

    
        
    
    

    you can give link like

      
    
     

    Artistic gymnastics world championship

    You can access this state in your News Page like

    { props.location.state !== undefined ? props.location.state.news : '' }

    After getting your news type like eyof :

    Step 1 :

       you can create on functional component which takes argument as your
     data and return your new post jsx with your data.
    

    Step2 :

       So,when you get your eyof in your page then you are going to call 
    this function and pass your data related to your eyof and that function 
    return your new post to your page.
    

提交回复
热议问题