From 1072303e20ddf2f2830f5d60c116b35f60640e37 Mon Sep 17 00:00:00 2001 From: Anton Korzunov Date: Sat, 2 Nov 2019 18:09:41 +1100 Subject: [PATCH] fix: dont write to elementType if it is not defined, fixes #1357 --- src/internal/getReactStack.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/internal/getReactStack.js b/src/internal/getReactStack.js index d0736b123..71819a7ab 100644 --- a/src/internal/getReactStack.js +++ b/src/internal/getReactStack.js @@ -42,7 +42,10 @@ const markUpdate = ({ fiber }) => { if (fiber.alternate) { fiber.alternate.expirationTime = 1; fiber.alternate.type = fiber.type; - fiber.alternate.elementType = fiber.elementType; + // elementType might not exists in older react versions + if ('elementType' in fiber.alternate) { + fiber.alternate.elementType = fiber.elementType; + } } if (fiber.memoizedProps && typeof fiber.memoizedProps === 'object') {