Skip to content

Commit 1072303

Browse files
committed
fix: dont write to elementType if it is not defined, fixes #1357
1 parent fbc890a commit 1072303

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/internal/getReactStack.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ const markUpdate = ({ fiber }) => {
4242
if (fiber.alternate) {
4343
fiber.alternate.expirationTime = 1;
4444
fiber.alternate.type = fiber.type;
45-
fiber.alternate.elementType = fiber.elementType;
45+
// elementType might not exists in older react versions
46+
if ('elementType' in fiber.alternate) {
47+
fiber.alternate.elementType = fiber.elementType;
48+
}
4649
}
4750

4851
if (fiber.memoizedProps && typeof fiber.memoizedProps === 'object') {

0 commit comments

Comments
 (0)