<Container>
<Routes>
<Route path="/" element={<HomeScreen/>} exact/>
<Route path="/product/:id" element={<ProductScreen/>}/>
<Route path="/cart/:id?" element={<CartScreen/>} />
</Routes>
</Container>
in the above code for cart screen id parameter is optional it may or may not present so i placed a "?" after id
const addToCart = () => {
navigate(`/cart/${id}?qty=${qty}`)
}
when i navigate to /cart/${id}?qty=${qty} i need to go to the CartScreen component how to do it