下面的代码工作正常,问题是我不想使用整个包,因为我只需要它的几个类,所以我检查了源代码并在我的页面上复制了类范围,但它没有按预期工作..
import 'react-toastify/dist/ReactToastify.css'
import 'animate.css/animate.min.css'
const bounce = cssTransition({
enter: 'animate__animated animate__bounceIn',//this should be source code
exit: 'animate__animated animate__bounceOut',
})
const App = () => {
return (
<>
<ToastContainer
position="top-center"
autoClose={4000}
transition={bounce}
hideProgressBar
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnHover
/>
在下面尝试了 css 但没有用(从源代码复制 .animate__animated 类);
const bounce = cssTransition({
enter: '-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-duration:var(--animate-duration);animation-duration:var(--animate-duration);-webkit-animation-fill-mode:both;animation-fill-mode:both',
exit: 'animate__animated animate__bounceOut',
})