import React, { useEffect, useState } from "react";
import "./Skill.css";
import { Fade } from "react-reveal";
function Skill({ name, color }) {
const [style, setStyle] = useState({ borderBottom: `4px solid ${color}` });
window.addEventListener("wheel", () => {
let scroll = window.scrollY;
console.log(scroll);
if (scroll >= 1300) {
setStyle({
animation: "load 2s ease-out",
display: "block",
borderBottom: `4px solid ${color}`,
});
}
});
return (
<>
<div className="skill">
<Fade bottom>
<div className="Skill__logo">
<img
className="logo__img"
src="./images/html-5-logo-svgrepo-com.svg"
alt=""
/>
</div>
<div className="skills__about">
<div className="skillitem">
<div className="skill__set">
<div className="skill__Name" style={{ color: color }}>
{name}
</div>
</div>
<div style={style} className="loading__skill"></div>
</div>
</div>
</Fade>
</div>
</>
);
}
export default Skill;
Need assistance with my code as the wheel event seems to be firing infinitely and causing my application to crash. Any insights on how to resolve this issue would be greatly appreciated.