ReactJS How do you switch between pages in React?

后端 未结 3 1037
青春惊慌失措
青春惊慌失措 2021-02-12 17:45

So coming from an Angular/AngularJS background, you have states, and each state is a separate page. E.g. in a social network you can have a state with your feed, a state with a

3条回答
  •  一生所求
    2021-02-12 18:26

    The problem you have mentioned can be adressed as how to deal with routing within app. For that please take a look at available solutions such as react-router.

    Another way you can tackle this problem is by moving out rendering different pages logic to component with would then render page based on data passed as props. For that you can use plain, old JavaScript object.

提交回复
热议问题