Skip to content

Commit

Permalink
fix: dont write to elementType if it is not defined, fixes #1357
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Nov 2, 2019
1 parent fbc890a commit 1072303
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/internal/getReactStack.js
Expand Up @@ -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') {
Expand Down

0 comments on commit 1072303

Please sign in to comment.