Skip to content

Conversation

@yoavf
Copy link
Contributor

@yoavf yoavf commented Dec 11, 2025

Changes

  • Fix the CodeBlock keys to be unique, even when two blocks are set to the same language (i.e bash like in the llm analytics page)

Prevents the following warning on the LLM analytics docs:

image

(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)

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
@vercel
Copy link

vercel bot commented Dec 11, 2025

@yoavf is attempting to deploy a commit to the PostHog Team on Vercel.

A member of the Team first needs to authorize it.

@yoavf yoavf changed the title fix: code block tabs not switching in OnboardingContentWrapper fix: react key warning in CodeBlock Dec 12, 2025
@vercel
Copy link

vercel bot commented Dec 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
posthog Ready Ready Preview Jan 5, 2026 9:22pm

Copy link
Contributor

@sarahxsanders sarahxsanders left a 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

Copy link
Contributor

@gewenyu99 gewenyu99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense :)

@gewenyu99
Copy link
Contributor

@smallbrownbike This look good to you?

Copy link
Collaborator

@smallbrownbike smallbrownbike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@smallbrownbike smallbrownbike merged commit 99e4a59 into PostHog:master Jan 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants