From ce0b9698d837c5b50731431a7cb8a1351af2b6a1 Mon Sep 17 00:00:00 2001 From: Jude Caacbay <73812582+jdcaacbay-wp@users.noreply.github.com> Date: Mon, 29 Nov 2021 16:26:36 +0800 Subject: [PATCH] Handle null card component When clearing the cards inside the card stack, it returns null error on a.key. Added a null handler --- CardStack.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CardStack.js b/CardStack.js index b83f65c..5fdcb12 100644 --- a/CardStack.js +++ b/CardStack.js @@ -161,7 +161,8 @@ class CardStack extends Component { } return true; } - if (a.key !== b.key) return false; + if(a !== null) + if (a.key !== b.key) return false; return true }