I suggest that you should write "{ component: component }" instead of "{ component: Component }". Otherwise the "component" you get from "<"PrivateRouter component={...} />" will be overwritten by "Component" from react. I just find it by console.log(component);
I suggest that you should write "{ component: component }" instead of "{ component: Component }". Otherwise the "component" you get from "<"PrivateRouter component={...} />" will be overwritten by "Component" from react. I just find it by console.log(component);