-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
docs: fix missing comma in useMutation example to prevent syntax errors #9593
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA documentation snippet in docs/framework/react/typescript.md was updated to add a trailing comma after a spread in a useMutation options object, correcting object literal property separation. No runtime logic, API, or behavior changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration 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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/framework/react/typescript.md (1)
252-255
: Comma after spread correctly fixes the object literal syntax — LGTMWithout this comma, the snippet would throw a parsing error because
onSuccess
wouldn’t be separated from the spread properties. The change is correct and improves copy-paste safety of the docs.For consistency with common Prettier settings on multi-line objects, consider adding a trailing comma after
onSuccess
as well:useMutation({ ...groupMutationOptions(), - onSuccess: () => queryClient.invalidateQueries({ queryKey: ['groups'] }) + onSuccess: () => queryClient.invalidateQueries({ queryKey: ['groups'] }), })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/framework/react/typescript.md
(1 hunks)
Summary
Fixed a missing comma in the useMutation example's options object:
The comma after the spread operator was missing, which would cause a syntax error if users copy and paste the example.
Changes
This change maintains consistency with JavaScript object literal syntax rules and enhances developer experience by providing error-free examples.
Summary by CodeRabbit