New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addressing issues after email #72
Conversation
Cleaned up the rest of the client code to be more hook friendly with no linter warnings now for all the useEffect hooks. |
instagram: loading || !profile.social ? '' : profile.social.instagram | ||
}); | ||
}, [loading, getCurrentProfile]); | ||
if (!profile) getCurrentProfile(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simpler useEffect that follows the linter suggestions.
@@ -4,48 +4,41 @@ import PropTypes from 'prop-types'; | |||
import { connect } from 'react-redux'; | |||
import { createProfile, getCurrentProfile } from '../../actions/profile'; | |||
|
|||
const initialState = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial state outside of component to avoid triggering a re-render in useEffect.
Merge pull request bradtraversy#72 from bushblade/master
Addressing issues after email
Merge pull request bradtraversy#72 from bushblade/master
Apart from a minor syntax error in routes/auth/profile.js and some unused and missing cases for auth reducer as far as I can see the app is running fine after fixing these issues.
I can login a user and get redirected, I can logout and get redirected.
I have contacted the individual who raised the issues in the course for more details and will follow up with him and update further if needed.
Should also fix issue #70