creativetimofficial / ct-light-bootstrap-dashboard-pro-react

LBD Pro React Version
20 stars 8 forks source link

How can I create dynamic routes without reloading data? #27

Closed duckdd7788 closed 5 years ago

duckdd7788 commented 6 years ago

Hi,

How can I create dynamic routes without reloading data? like changing the URL without reloading the page?

I created the Breadcrumbs like items and :itemId. I had the data of items loaded on items page from an api endpoints. However, it reloads the data and refreash the state every time I go back to items page from item detail page.

einazare commented 6 years ago

Hello there @duckdd7788 ,

Thank you for your interest in working with our products. I think this is caused by the fact that you have your API call inside the items page. And everytime that component is mounted, the API call is made.

Best, Manu

duckdd7788 commented 6 years ago

What would be your suggestion for storing the data when I am back to items page?

einazare commented 6 years ago

Hello again @duckdd7788 ,

I think you could use Redux.

Best, Manu