I am new to reactjs. My question may be very simple for react developers but i thought to get some help over this forum folks.
I have two different pages, one is route configuration page and another is link page where i am trying to load another component that redirects to cart page that shows list of items in cart. So from by default module that is homepage(app.js) it has to redirect to cart page.
I m using react router v1.0.
Route configuration page:(app.js)
React.render((<Router>
<Route path="/" component={FluxShoppingCart}>
<IndexRoute component={FluxShoppingCart}/>
<Route name="cart" component={ViewCart} />
</Route>
</Router>),document.getElementById('container'));
Link Page:(Flux Cart Component)
<Link to="cart"><button type="button" className="btn btn-default btn-sm">Cart {totalCartItems}</button></Link>
Both are in different pages. Now when i am trying to click on Cart button that is updating url with some query params as well. On default loading its showing
http://localhost:8080/#/?_k=exw21r
and on link with cart its showing
http://localhost:8080/#/cart?_k=xme60o
Could any one help me by correcting my code/sharing some resources(blogs/videos) that helps me out in this scenario. I need to load default component and on clicking cart button it has to redirect to another component. I checked many examples in internet which shows working with different components on same page, but i am using in different pages. Please do the needful. Thanks in advance.