Explorar o código

Fix same path warning

close #159

ref ReactTraining/react-router#4467
afc163 %!s(int64=8) %!d(string=hai) anos
pai
achega
c0c65a0f43
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/layouts/BasicLayout.js

+ 5 - 1
src/layouts/BasicLayout.js

@@ -151,7 +151,11 @@ class BasicLayout extends React.PureComponent {
                 {icon}<span>{item.name}</span>
               </a>
             ) : (
-              <Link to={itemPath} target={item.target}>
+              <Link
+                to={itemPath}
+                target={item.target}
+                replace={itemPath === this.props.location.pathname}
+              >
                 {icon}<span>{item.name}</span>
               </Link>
             )