Skip to content

Add task solution#2027

Open
iteamfox wants to merge 1 commit into
mate-academy:masterfrom
iteamfox:develop
Open

Add task solution#2027
iteamfox wants to merge 1 commit into
mate-academy:masterfrom
iteamfox:develop

Conversation

@iteamfox

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Great job! 🎉 Your implementation meets all the core requirements: the static post list is displayed correctly, components are well-structured and typed, and all logic works as expected. The only minor issue is the deprecated "jsx": "react" setting in your tsconfig.json—consider updating it to "react-jsx" for better compatibility with newer TypeScript versions. Also, while your data transformation outside the component is fine for this static task, keep in mind that if future requirements specify using hooks or asynchronous fetching, you may need to refactor. Overall, your code is functional and well-organized—keep up the good work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread src/App.tsx
Comment on lines +4 to +6
import postsFromServer from './api/posts';
import commentsFromServer from './api/comments';
import usersFromServer from './api/users';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: If the checklist requires asynchronous data fetching or use of hooks (such as useEffect/useState), importing and using static data at the top level may not comply. Please verify the checklist for requirements regarding data fetching or transformation location.

Comment thread src/App.tsx
Comment on lines +9 to +15
const posts = postsFromServer.map(post => {
return {
...post,
comments: commentsFromServer.filter(comment => comment.postId === post.id),
user: usersFromServer.find(user => user.id === post.userId),
};
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential issue: The transformation of posts, comments, and users is performed outside of the React component. If the checklist requires this logic to be inside the component or to use React hooks, this should be refactored accordingly.

Comment thread tsconfig.json
"src"
],
"compilerOptions": {
"jsx": "react",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value 'react' for the 'jsx' compiler option is deprecated in newer TypeScript versions. If your project or checklist requires compatibility with the latest React and TypeScript, consider changing it to 'react-jsx'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants