Wow.js in React – Uncaught TypeError: Cannot set properties of undefined (setting 'getPropertyValue')

huangapple go评论59阅读模式
英文:

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)

Error

Install: npm install --save wowjs

Dependency: &quot;wowjs&quot;: &quot;^1.1.3&quot;

Index.html animate cdn:
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css&quot;/&gt;

My import:

import WOW from &quot;wowjs&quot;;

My initialization:

useEffect(() =&gt; {
    const newWOW = () =&gt; {new WOW.WOW({live: false}).init();}
    newWOW()
  }, []);

Label trying to call the animation

&lt;div className=&quot;homeSec__center wow animate__fadeIn&quot; data-wow-duration=&quot;1.5s&quot;&gt;

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 &quot;wow.js&quot;

huangapple
  • 本文由 发表于 2023年2月16日 08:59:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/75466842.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定