fix: react-animate-height issues for esm
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import AnimateHeight from 'react-animate-height'
|
import AnimateHeightWithDefault from 'react-animate-height'
|
||||||
|
|
||||||
|
// @ts-expect-error trust me it works
|
||||||
|
const AnimateHeight = AnimateHeightWithDefault || AnimateHeightWithDefault.default
|
||||||
|
|
||||||
import type { Props } from './types'
|
import type { Props } from './types'
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ import { useWindowInfo } from '@faceless-ui/window-info'
|
|||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import { fieldAffectsData } from 'payload/types'
|
import { fieldAffectsData } from 'payload/types'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import AnimateHeight from 'react-animate-height'
|
import AnimateHeightWithDefault from 'react-animate-height'
|
||||||
|
|
||||||
|
// @ts-expect-error trust me it works
|
||||||
|
const AnimateHeight = AnimateHeightWithDefault || AnimateHeightWithDefault.default
|
||||||
|
|
||||||
import type { Props } from './types'
|
import type { Props } from './types'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import AnimateHeight from 'react-animate-height'
|
import AnimateHeightWithDefault from 'react-animate-height'
|
||||||
|
|
||||||
import { Chevron } from '../../icons/Chevron'
|
import { Chevron } from '../../icons/Chevron'
|
||||||
import { usePreferences } from '../../providers/Preferences'
|
import { usePreferences } from '../../providers/Preferences'
|
||||||
@@ -14,6 +14,9 @@ type Props = {
|
|||||||
label: string
|
label: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error trust me it works
|
||||||
|
const AnimateHeight = AnimateHeightWithDefault || AnimateHeightWithDefault.default
|
||||||
|
|
||||||
const NavGroup: React.FC<Props> = ({ children, label }) => {
|
const NavGroup: React.FC<Props> = ({ children, label }) => {
|
||||||
const [collapsed, setCollapsed] = useState(true)
|
const [collapsed, setCollapsed] = useState(true)
|
||||||
const [animate, setAnimate] = useState(false)
|
const [animate, setAnimate] = useState(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user