-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
task solution #2017
base: master
Are you sure you want to change the base?
task solution #2017
Conversation
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.
Good job! 🥇 . I have left some comments for future reference.
export const UserInfo: React.FC<Props> = ({ user }) => ( | ||
<a className="UserInfo" href={`mailto:${user?.email}`}> | ||
{user?.name} | ||
</a> | ||
); |
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.
Destructure user object
|
||
export const CommentList: React.FC = () => <>Put the list here</>; | ||
export const CommentList: React.FC<{ comments: Comment[] }> = ({ |
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.
Once you declare the type interface and once you do not, stay consistent with your approach.
|
||
export const CommentInfo: React.FC = () => <>Put the comment here</>; | ||
export const CommentInfo: React.FC<{ comment: Comment }> = ({ |
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.
Here is an article on why you shouldn't use React.FC https://dev.to/elhamnajeebullah/react-typescript-what-is-reactfc-and-why-should-i-use-it-4029
DEMO LINK