Stanko / react-animate-height

Lightweight React component for animating height using CSS transitions. Slide up/down the element, and animate it to any specific height.
https://muffinman.io/react-animate-height
MIT License
756 stars 53 forks source link

Failed to execute 'createElement' #148

Open ross-lanes opened 1 year ago

ross-lanes commented 1 year ago

It looks like the default export for the ems is not a string and not the component object as of v3.2.2/3.2.1 to resolve reverted to 3.2.0

Expected behavior import AnimateHeight from 'react-animate-height'; results in AnimateHeight being a react component

current behavior import AnimateHeight from 'react-animate-height'; results in AnimateHeight being the string (ex: '/static/media/index.c7618d05.cjs'

This results in the error

InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/index.c7618d05.cjs') is not a valid name.

Possible Solution I have no clue why this is happening

Steps to Reproduce (for bugs) create an application using v3.2.2 that compiles using vite.JS or react-scripts and renders an AnimateHeight component

Your Environment

Stanko commented 1 year ago

Hey @Bestadd, Thank you for the detailed report. These exports are going to be the end of me 🙈 I'm in a very busy project atm, but I'll make sure to tackle this by the end of the week. Cheers!

Stanko commented 1 year ago

Hey, I can't replicate this. I tried it locally and on StackBlitz and imports work fine.

Vite: https://stackblitz.com/edit/vitejs-vite-avkgx3?file=src%2FApp.tsx

react-scripts: https://stackblitz.com/edit/react-starter-69nigk?file=package.json%2CHello.js

Any idea how to replicate it?

Cyclodex commented 10 months ago

Hey, I just had the same issue, when trying out this lib. However I could manually fix it with importing directly the esm version:

import AnimateHeight, { Height } from 'react-animate-height/dist/esm/index';

Could also not yet reproduce it on stackblitz :( Running on react 16.13 but this seems not to be the issue Also putting the tsconfig.json into it, didn't made stackblitz fail...

Stanko commented 10 months ago

Hey, it would be awesome if we can figure out the way to reproduce it, I can't make it happen on my machine. Any ideas?