fix: react-animate-height issues for esm

This commit is contained in:
Alessio Gravili
2024-03-06 18:36:18 -05:00
parent e3dff56479
commit 140d5242cf
3 changed files with 12 additions and 3 deletions

View File

@@ -1,6 +1,9 @@
'use client'
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'

View File

@@ -3,7 +3,10 @@ import { useWindowInfo } from '@faceless-ui/window-info'
import { getTranslation } from '@payloadcms/translations'
import { fieldAffectsData } from 'payload/types'
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'

View File

@@ -1,6 +1,6 @@
'use client'
import React, { useEffect, useState } from 'react'
import AnimateHeight from 'react-animate-height'
import AnimateHeightWithDefault from 'react-animate-height'
import { Chevron } from '../../icons/Chevron'
import { usePreferences } from '../../providers/Preferences'
@@ -14,6 +14,9 @@ type Props = {
label: string
}
// @ts-expect-error trust me it works
const AnimateHeight = AnimateHeightWithDefault || AnimateHeightWithDefault.default
const NavGroup: React.FC<Props> = ({ children, label }) => {
const [collapsed, setCollapsed] = useState(true)
const [animate, setAnimate] = useState(false)