From 18df5b994adb34324c3c0143b8da1a67e622bea7 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 9 Jan 2019 12:07:57 +0100 Subject: [PATCH] refactor - use of PureComponents to avoid useless re-rendering --- .eslintrc.json | 2 +- .../Activities/ActivitiesFilter.jsx | 330 +++++++++--------- .../components/Activities/ActivitiesList.jsx | 36 +- .../src/components/NavBar/index.jsx | 247 ++++++------- 4 files changed, 312 insertions(+), 303 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 5bbb54c8..48b39fbf 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -320,7 +320,7 @@ "react/no-unknown-property": "error", "react/no-unused-prop-types": "off", "react/prefer-es6-class": "error", - "react/prefer-stateless-function": "error", + "react/prefer-stateless-function": [1, { "ignorePureComponents": true }], "react/prop-types": "off", "react/react-in-jsx-scope": "error", "react/react-default-props": "off", diff --git a/fittrackee_client/src/components/Activities/ActivitiesFilter.jsx b/fittrackee_client/src/components/Activities/ActivitiesFilter.jsx index 0b9e2119..a78fa2e9 100644 --- a/fittrackee_client/src/components/Activities/ActivitiesFilter.jsx +++ b/fittrackee_client/src/components/Activities/ActivitiesFilter.jsx @@ -1,176 +1,178 @@ import React from 'react' -export default function ActivitiesList (props) { - const { loadActivities, sports, updateParams } = props - return ( -
-
-
event.preventDefault()}> -
- - -
-
- -
-
-