Closed VaneeOfficialNet closed 1 year ago
is it because of the propTypes's version? the error message looks the arrayOf if not a funciton, but this lib is not using arrayOf in any places, no idea to be honest
I had this issue myself and if I can remember correctly it is because this library literally exports the wrong component types for some of the components.
I wound up just copying the source code into my project instead, fixing some silly bugs like one of the male avatars only being able to have one hair style or color.
Hi @VaneeOfficialNet I tried myself with vite+react+ts, but I don't get any errors in both dev and preview, any attributes you passed into the genConfig
?
My local testing simply is:
import './App.css'
import Avatar, { genConfig } from 'react-nice-avatar'
function App() {
const config = genConfig()
return (
<>
<Avatar style={{ width: '8rem', height: '8rem' }} {...config} />
</>
)
}
export default App
Locally the package works fine in Vite React Typescript.. However, getting error with getConfig(). TypeError: propTypes$1.exports.arrayOf is not a function. (In 'propTypes$1.exports.arrayOf(propTypes$1.exports.node)', 'propTypes$1.exports.arrayOf' is undefined)