React component not render anything, except after I refresh page

I’m using react router, but when I change page my component doesn’t render anything just show white page, but it render when page refreshing

This is my route list: routes.tsx

And this is my App.tsx : App.tsx

index.tsx: index.tsx


Instead of having the empty container <> </> use switch to wrap your routes



then you can just import it as you were without the switch enclosing as:

  <Routes />