Answers for "useEffect not triggering after hooks state array update"

0

useEffect not triggering after hooks state array update

const [skills, selectedSkills] = useState([])

     const onSelect = (selectedList) => {
            const tempSelectedList = [...selectedList]
            selectedSkills(tempSelectedList)
        }
     useEffect(() => {
            MyLogger('useEffect called')
        }, [skills])
Posted by: Guest on April-23-2021

Code answers related to "useEffect not triggering after hooks state array update"

Browse Popular Code Answers by Language