feat: Update shadcn ui 4#691
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request overhauls the UI component library by adding new components like Carousel and Chart, and updating existing ones to a new design style using Radix UI primitives and OKLCH color variables. The review identified a critical logic error in the Field component where an async function is incorrectly passed to useMemo, which will lead to incorrect rendering behavior. Additionally, several hardcoded strings in the Pagination and Sidebar components should be externalized to the translation files to ensure proper internationalization support.
| // eslint-disable-next-line react-hooks/use-memo, @eslint-react/use-memo | ||
| const content = useMemo(async () => { |
There was a problem hiding this comment.
The useMemo callback is marked as async, which is invalid. useMemo expects a synchronous function that returns a value. An async function returns a Promise, which cannot be rendered directly in a client component and will cause the if (!content) check on line 213 to always be false (as a Promise object is truthy). Since the logic inside the callback is synchronous, the async keyword should be removed.
References
- React hooks like useMemo must have synchronous callbacks to return the computed value immediately for rendering.
…ds and minimumReleaseAgeExclude settings
Improving Documentation
pnpm lint:fixto fix formatting issues before opening the PR.Description
What?
Why?