Skip to content

Commit

Permalink
using optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
WillMayger committed Dec 1, 2020
1 parent aa32daf commit 6c6d742
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions packages/gatsby/cache-dir/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,7 @@ const compareLocationProps = (prevLocation, nextLocation) => {
return true
}

if (
(prevLocation.state === null && nextLocation.state !== null) ||
(prevLocation.state !== null && nextLocation.state === null)
) {
return true
}

if (
prevLocation.state !== null &&
nextLocation.state !== null &&
prevLocation.state.key !== nextLocation.state.key
) {
if (prevLocation?.state?.key !== nextLocation?.state?.key) {
return true
}

Expand Down

0 comments on commit 6c6d742

Please sign in to comment.