Skip to content

Conversation

@stipsan
Copy link
Member

@stipsan stipsan commented Nov 11, 2024

Follows the principles detailed in this thread: facebook/react#31330 (comment)

While at it I cleaned up useArrayProp, which internally seems to never actually use defaultValue. Since the hook is exported I've added a compat hook in src/core/hooks/useArrayPropLegacy.ts so that third party libraries that make use of the useArrayProp(value, defaultValue) pattern continue working.
They'll get a deprecated warning though and tell them to migrate to useArrayProp(value ?? defaultValue).

This PR also takes care of the linter warning for useUnique inside src/core/utils/portal/portalProvider.tsx

@vercel
Copy link

vercel bot commented Nov 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sanity-ui-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 11, 2024 11:05pm
sanity-ui-workshop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 11, 2024 11:05pm

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.

1 participant