-
Notifications
You must be signed in to change notification settings - Fork 717
fix: react key warning in CodeBlock #14070
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
fix: react key warning in CodeBlock #14070
Conversation
When you have two tabs and they are both set to the same language switching breaks because the key to the element was set to the lang and was repeating itself Additionally - the useEffect was resetting the state unnecessarily
|
@yoavf is attempting to deploy a commit to the PostHog Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
sarahxsanders
left a comment
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.
approved! the fix looks good. I tested and verified on posthog.com/docs/api/capture, it has lots of code snips :) ran it locally before/after the change and the warning is gone from the console
gewenyu99
left a comment
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.
This makes sense :)
|
@smallbrownbike This look good to you? |
smallbrownbike
left a comment
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.
Looks good, thanks!
Changes
Prevents the following warning on the LLM analytics docs:
(This PR also contained the fix for the non-working tabs, but that was done in #14075 - so updated to only fix the above warning)