Skip to content

Commit

Permalink
Update events.ts
Browse files Browse the repository at this point in the history
sort by distance even when root state is undefined.
  • Loading branch information
Inuniku committed Oct 28, 2022
1 parent 87644eb commit 775572c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/fiber/src/core/events.ts
Expand Up @@ -224,7 +224,7 @@ export function createEvents(store: UseBoundStore<RootState>) {
.sort((a, b) => {
const aState = getRootState(a.object)
const bState = getRootState(b.object)
if (!aState || !bState) return 0
if (!aState || !bState) return a.distance - b.distance
return bState.events.priority - aState.events.priority || a.distance - b.distance
})
// Filter out duplicates
Expand Down

0 comments on commit 775572c

Please sign in to comment.