510 questions
1
vote
1
answer
122
views
React router dom v6.26.1 changes url but not re-render the component
I'm having an issue with the page refresh after, when clicking on the button url gets changed in the browser but the page doesn't refresh the correct component, no browser error no terminal error, ...
0
votes
1
answer
426
views
Welcome to nginx page on React dockerized app
I created a React app and oused react-router for the routes. When I serve the app using npm start, it works perfectly. But when I dockerize it and use nginx, all I get when executing the app is the &...
0
votes
2
answers
1k
views
How to redirect from redux (w/ react router v6)?
With react-router 5 I used library - react-connected-router to make redirect from redux store. This library doesnt work with react router 6. How I can implement this?
I can just put navigate from ...
-1
votes
1
answer
204
views
Provider from react-redux Doesn't Work for me
This is the code in index file
the packages
i try to copy past a valid code but it doesnt work
Please if anyone has the same probléme can help me
2
votes
1
answer
737
views
How to push to History in React Router v6? I face with not found message
I used react@18, redux, and react-router@6. I have a button add to cart on my product page and I want the product to be added to local storage and I have that product on my Cart page. After clicking ...
-1
votes
1
answer
75
views
i am stuck in react router dom can anyone help me
HOw my website looking before commit
click to view
my App.js file
<Routes>
<Route path="/" element={<Navbar />}>
<Route path="" element={<...
1
vote
1
answer
487
views
CartItems routing error using React-Router-Dom v6
I am trying to introduce 'cartItems' functionality to my react-redux app and store the added data in the browser's local storage.
Indeed the problem raises when I try to show cart items by clicking on ...
1
vote
1
answer
1k
views
No routes matched location for cartItems app
There is a routing problem with using react-router-dom v6 to maintain "cart items" functionality in my app.
So it doesn't show cart items when I click on the "cart" link in the ...
2
votes
1
answer
636
views
Redux how to get updated store state in root component
My root App component looks like this:
class App extends Component {
render() {
const state = store.getState();
const { isAuthenticated } = state.auth;
return (
<Provider store=...
0
votes
1
answer
845
views
PrivateRoute isn't working, react route changes v5 - v6.2 [duplicate]
My code isn't working due to the changes of React route from v5 to v6.2. could you please help me change PrivateRoute.js details to match the requirements of v6.2?
PrivateRoute.js;
strong text
import ...
-1
votes
1
answer
396
views
Cant read a value from redux toolkit store on different components
I'm trying to create a redux toolkit that store an object so I could read the object values from different components on different react-router path
when calling to read the values that stores in the ...
0
votes
2
answers
245
views
Control the URL bar with JavaScript
Is there some function in javascript or React.js to tell if a user tries to access an existing page through the URL bar?
0
votes
2
answers
235
views
React component doesnnt re render
im passing values using react redux everything is passed but the component i want to render only renders 1 time and when i save my code in vscode (it renders again)the data renders on page like it ...
0
votes
0
answers
517
views
History.push does not redirect when only the param changes but it changes the url in the browser
I have this route:
<PrivateRoute path="/profile/:user_id" exact component={GenericProfile} />;
This is the PrivateRoute component:
const PrivateRoute = ({ component: Component, ...
0
votes
2
answers
84
views
Why aren't components being rendered according to route?
I'm using react router and I have created a route with the path /account which renders the Account component. That component renders a navbar. Below that navbar I want it to render a different ...