From 3d581dbf44125410e3bfe71c23f2a800b73a713c Mon Sep 17 00:00:00 2001 From: Talha Naqvi Date: Tue, 29 Mar 2022 15:08:08 -0700 Subject: [PATCH] removed no-op set state (#703) Co-authored-by: Talha Naqvi --- src/core/RecyclerListView.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/RecyclerListView.tsx b/src/core/RecyclerListView.tsx index 8039db42..2238d780 100644 --- a/src/core/RecyclerListView.tsx +++ b/src/core/RecyclerListView.tsx @@ -147,6 +147,7 @@ export default class RecyclerListView

{ - this.setState((prevState) => { - return prevState; - }); + if (this._isMounted) { + this.setState((prevState) => { + return prevState; + }); + } }); }