pfe application
Сообщение об ошибке:
Строка 9: 6: React Hook useEffect отсутствует зависимость: 'getCurrentProfile'. Либо включите его, либо удалите массив зависимостей. Если 'getCurrentProfile' меняется слишком часто, найдите родительский компонент, который его определяет, и оберните это определение в useCallback response-hooks / исчерпывающее-deps.
мой код
import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { getCurrentProfile } from '../../actions/profile';
const Dashboard = ({ getCurrentProfile, auth, profile }) => {
useEffect(() => {
getCurrentProfile();
}, []);
return <div>Dashboard</div>;
};
Dashboard.propTypes = {
getCurrentProfile: PropTypes.func.isRequired,
auth: PropTypes.object.isRequired,
profile: PropTypes.object.isRequired,
};
const mapStateToProps = (state) => ({
auth: state.auth,
profile: state.profile,
});
export default connect(mapStateToProps, { getCurrentProfile })(Dashboard);