دوستان این کلاس میخوام به هوک ببرم به چه شکل میشه؟
state = {
list: [],
backgroundColor: 'rgba(۲۵۵, ۲۵۵, ۲۵۵, ۰.۶ )',
transitionDelay: "۲s"
};
componentDidMount() {
this.getdata();
window.addEventListener('scroll', this.listenScrollEvent);
}
listenScrollEvent = _e => {
if (window.scrollY > ۷۰) {
this.setState({backgroundColor: 'white'})
this.setState({transitionDelay: "۲s"})
} else {
this.setState({backgroundColor: 'rgba(۲۵۵, ۲۵۵, ۲۵۵, ۰.۷)'})
}
}
    import React, { useState, useEffect } from 'react';
    function Example() {
        const [list, setList] = useState([]);
        const [backgroundColor, setBackgroundColor] = useState('rgba(255, 255, 255, 0.6 )');
        const [transitionDelay, setTransitionDelay] = useState('2s');
        useEffect(() => {
            getdata();
            window.addEventListener('scroll', this.listenScrollEvent);
        });
        listenScrollEvent = _e => {
            if (window.scrollY > '70') {
                setBackgroundColor('white');
                setTransitionDelay('2s');
            } else {
                setBackgroundColor('rgba(255, 255, 255, 0.7)');
            }
        }
        function getdata(){
            return setList([]);
        }
        return (
            <div>
                // JSX
            </div>
        );
    }
                                آیا مایل به ارسال نوتیفیکیشن و اخبار از طرف راکت هستید ؟