You'll need to make it so that there's no name collision. You could rename the import, or rename the destructured prop, or don't destructure the props at all.
Actually, it doesn't look like the getCurrentProfile
prop is used at all, so you could just remove it from the parameter list:
const Dashboard = ({
auth: { user }
}) => {
useEffect(getCurrentProfile, []);
return (
<Fragment>
<h1> DAshboard</h1>
<i className='das fa-user'></i><p>Welcome {user && user.name}</p>
</Fragment>
);
};
If you actually are using the getCurrentProfile
prop somewhere, then you could do
const Dashboard = (props) => {
const { user } = props.auth;
useEffect(getCurrentProfile, []);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…