fix: resolve TypeScript errors in release-list component#1
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR resolves TypeScript errors in the release-list component by fixing type issues in the ReactMarkdown code component customization. The changes restructure how props are handled and add necessary type assertions to satisfy TypeScript's type checking.
Key Changes:
- Refactored props destructuring in the ReactMarkdown code component to avoid TypeScript errors
- Added type assertion for the
oneDarkstyle object to satisfy react-syntax-highlighter's type requirements - Replaced the
inlineprop with computedisInlinelogic based on language match detection
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| website/tsconfig.tsbuildinfo | TypeScript build artifact updated after compilation |
| website/src/components/releases/release-list.tsx | Fixed TypeScript errors in code component by restructuring props handling and adding type assertion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const isInline = !match; | ||
|
|
||
| return !isInline && match ? ( |
There was a problem hiding this comment.
[nitpick] The isInline variable and the condition !isInline && match could be simplified. Since isInline = !match, the condition !isInline && match is equivalent to just checking match. Consider simplifying to:
const match = /language-(\w+)/.exec(className || '');
return match ? (
// block code with syntax highlighting
) : (
// inline code
);This makes the logic clearer and removes the unnecessary intermediate variable.
| const isInline = !match; | |
| return !isInline && match ? ( | |
| return match ? ( |
Merge pull request #1 from codeMaestro78/website-up
No description provided.