Add task solution#2027
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
| import postsFromServer from './api/posts'; | ||
| import commentsFromServer from './api/comments'; | ||
| import usersFromServer from './api/users'; |
There was a problem hiding this comment.
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.
| const posts = postsFromServer.map(post => { | ||
| return { | ||
| ...post, | ||
| comments: commentsFromServer.filter(comment => comment.postId === post.id), | ||
| user: usersFromServer.find(user => user.id === post.userId), | ||
| }; | ||
| }); |
There was a problem hiding this comment.
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.
| "src" | ||
| ], | ||
| "compilerOptions": { | ||
| "jsx": "react", |
There was a problem hiding this comment.
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'.
No description provided.