@sanity/ui 2.9.0-canary.1 → 2.9.0-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "2.9.0-canary.1",
3
+ "version": "2.9.0-canary.2",
4
4
  "keywords": [
5
5
  "sanity",
6
6
  "ui",
@@ -443,7 +443,8 @@ Popover.displayName = 'Memo(ForwardRef(Popover))'
443
443
  // https://github.com/facebook/react/pull/28348
444
444
  //
445
445
  // Access the ref using the method that doesn't yield a warning.
446
- function getElementRef(element: React.ReactElement) {
446
+ function getElementRef(element?: React.ReactElement) {
447
+ if (!element) return null
447
448
  // React <=18 in DEV
448
449
  let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get
449
450
  let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning