-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
refactor: solved the bug mentioned in #246 #247
Conversation
Someone is attempting to deploy a commit to a Personal Account owned by @Sanchitbajaj02 on Vercel. @Sanchitbajaj02 first needs to authorize it. |
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.
Great job, @Girishbari! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project. Keep being the part of the community!
'We will promptly review your changes and offer feedback. Keep up the excellent work!
Kindly remember to check our Contributing Guidelines'
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe updates enhance the editor's functionality by introducing new menu items for text formatting (bold, italic, etc.) and improving the mapping functions in two components for better key management. This directly addresses the issue with non-unique keys in Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (2)
- src/components/Editor/EditorMenuBar.tsx (2 hunks)
- src/components/Editor/Markdown.tsx (2 hunks)
Additional comments: 1
src/components/Editor/EditorMenuBar.tsx (1)
- 24-147: The addition of unique IDs for new menu items is a good practice and enhances the editor's functionality. Ensure that these IDs remain unique as more items are added in the future.
BubbleMenuFunctions.map((func, index) => ( | ||
<button | ||
key={func.title} | ||
key={index} |
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.
Using index as a key is a valid workaround for non-unique keys but can lead to performance issues and bugs in dynamic lists. Consider using a more stable and unique identifier if possible.
FloatingMenuFunctions.map((func, index) => ( | ||
<button | ||
key={func.title} | ||
key={index} |
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.
Similar to the previous comment, using index as a key here is a workaround. Advise considering more stable and unique identifiers for keys to avoid potential issues in dynamic lists.
Related Issue
Fix: #246
Description
.map method in EditorMenuBar.tsx and Markdown.tsx does not had unique KEY prop it was an earlier item.title whereas the title was not unique which caused the issue
Screenshots
current behaviour of console
![image](https://private-user-images.githubusercontent.com/38005544/303993192-599acf32-d512-48f8-866b-38b703768fd2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1MzY5ODAsIm5iZiI6MTcxOTUzNjY4MCwicGF0aCI6Ii8zODAwNTU0NC8zMDM5OTMxOTItNTk5YWNmMzItZDUxMi00OGY4LTg2NmItMzhiNzAzNzY4ZmQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDAxMDQ0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ4NThlNDdlMmEwOGNlZDFlNjBkMzlhYzI3OWUxYjkyZDkyMTIxZWI3OThlMTNkMGY1NzJmZmU2MGI3N2MwMmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.6INRgbnag5LVRdbmLwPfXmChKgnlMpJqV6GqcR6Io1A)
current errors are not related with above issue