0
ALERT: React Hook useEffect has a Missing dependency: 'Dispatcher'. Either include it or remove the dependency array React-Hooks/exhaustive-deps
import React, {useEffect} from 'react'
import {useDispatch, useSelector} from 'react-redux'
import ACTION from './Action'
const App = () => {
const dispatch = useDispatch();
const REDUCER_USUARIOS = useSelector(state => state.ReducerUsuarios)
//Estou usando como componentDidMount()
useEffect(() => {
dispatch(ACTION.CARREGAR())
}, [])
console.log(REDUCER_USUARIOS)
return <div>TEST</div>
}
NOTE: I am using React(version:16.12) and React-Redux(version:7.1.3) with Hooks.
Thanks Vicenzo! That’s right.
– Lucas Gabriel Sousa