Преглед изворни кода

forEach should be used instead of map (#3332)

onceyoung пре 7 година
родитељ
комит
fd116eeded
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/layouts/BasicLayout.js

+ 1 - 1
src/layouts/BasicLayout.js

@@ -99,7 +99,7 @@ class BasicLayout extends React.PureComponent {
   getRouterAuthority = (pathname, routeData) => {
     let routeAuthority = ['noAuthority'];
     const getAuthority = (key, routes) => {
-      routes.map(route => {
+      routes.forEach(route => {
         if (route.path && pathToRegexp(route.path).test(key)) {
           routeAuthority = route.authority;
         } else if (route.routes) {