英文:
Wow.js in React - Uncaught TypeError: Cannot set properties of undefined (setting 'getPropertyValue')
问题
我正在尝试在一个新的应用程序中使wow.js工作,但我找不到关于我遇到的错误的答案。
奇怪的是,我已经在其他个人项目中完成了这个操作,而且一切都运行得很完美。与其他项目相比,我发现的唯一区别是,这次我是使用vite初始化安装的(尽管我不认为这与问题有任何关系,我只是为了澄清一下)
安装: npm install --save wowjs
依赖项: "wowjs": "^1.1.3"
Index.html 引用 animate.css 的 CDN:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
我的导入:
import WOW from "wowjs";
我的初始化:
useEffect(() => {
const newWOW = () => {new WOW.WOW({live: false}).init();}
newWOW()
}, []);
尝试调用动画的标签
<div className="homeSec__center wow animate__fadeIn" data-wow-duration="1.5s">
提前感谢您的帮助。
英文:
I'm trying to get wow.js working in a new application, and I can't find an answer to the error I'm getting.
The strange thing is that I have already done it in other personal projects, and it has worked perfectly. The only difference I find compared to the other projects is that this time I initialized the installation with vite (although I don't think it has anything to do with it, I'll clarify it just in case)
Install: npm install --save wowjs
Dependency: "wowjs": "^1.1.3"
Index.html animate cdn:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
My import:
import WOW from "wowjs";
My initialization:
useEffect(() => {
const newWOW = () => {new WOW.WOW({live: false}).init();}
newWOW()
}, []);
Label trying to call the animation
<div className="homeSec__center wow animate__fadeIn" data-wow-duration="1.5s">
Thank you in advance for trying to help me.
答案1
得分: 0
使用wow.js
而不是wowjs
。
npm install --save wow.js
import WOW from "wow.js"
英文:
Use wow.js instead of wowjs.
npm install --save wow.js
import WOW from "wow.js"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论