Sfoglia il codice sorgente

change map to forEach

zamis 5 anni fa
parent
commit
ab122d5625
1 ha cambiato i file con 1 aggiunte e 3 eliminazioni
  1. 1 3
      src/client/js/components/Page/RevisionLoader.jsx

+ 1 - 3
src/client/js/components/Page/RevisionLoader.jsx

@@ -57,9 +57,7 @@ class RevisionLoader extends React.Component {
       }
     }
     catch (errors) {
-      errors.map((error) => {
-        return this.setState({ markdown: error.message });
-      });
+      errors.forEach((error) => { this.setState({ markdown: error.message }) });
     }
     finally {
       this.setState({ isLoaded: true, isLoading: false });