I have this component:
import React from 'react';
import { useSelector, useDispatch } from 'react-redux';
import inputAction from '../../redux/actions/inputActions';
import clienteActions from '../../redux/actions/clientesAction';
const clientes = () => {
const dispatch = useDispatch();
const clientes = useSelector(state => state.clientes.clientes);
//.... more code
}
ant I have an error in this line:
const dispatch = useDispatch();
this is the error
src\components\clientes\clientes.js
Line 7:22: React Hook "useDispatch" is called in function "clientes" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter react-hooks/rules-of-hooks
Line 8:22: React Hook "useSelector" is called in function "clientes" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter react-hooks/rules-of-hooks
what I wrong???