Skip to content

fix: remove all-primitive-deps warning from useDeepCompareEffect / useShallowCompareEffect#2714

Open
devthedevil wants to merge 2 commits into
streamich:masterfrom
devthedevil:fix/755-remove-primitive-warning
Open

fix: remove all-primitive-deps warning from useDeepCompareEffect / useShallowCompareEffect#2714
devthedevil wants to merge 2 commits into
streamich:masterfrom
devthedevil:fix/755-remove-primitive-warning

Conversation

@devthedevil

Copy link
Copy Markdown

Fixes #755

What

Removes the console.warn that fires when every value in the deps array passed to useDeepCompareEffect / useShallowCompareEffect is a primitive. The "no dependencies passed" warning is left untouched.

Why

A dependency that starts as undefined and later becomes an object is valid, expected usage of these hooks — but the current all-primitive check warns on the very first render regardless. The maintainer confirmed in the issue thread that this specific warning should be removed while keeping the no-dependencies warning: #755 (comment)

No existing tests assert on console.warn, so behavior otherwise is unchanged.

This PR was opened by an automated OSS contribution bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove warnings from useDeepCompareEffect

1 participant