salsita / spicy-hooks

7 stars 0 forks source link

`utils/isShallowEqual` chokes on null #31

Closed goce-cz closed 3 years ago

goce-cz commented 3 years ago

When one of the arguments passed to isShallowEqual is null and the other one is plain object, the function throws:

TypeError: Cannot use 'in' operator to search for 'width' in null

The reason is that typeof null === 'object' and the function then tries comparing the two property by property.