This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
updating component.tsx to fix issue with anchor sub links not working… #1658
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1645 … on Props and Theming tabs
#1645
📝 Description
The anchor links on the "Props" and "Theming" tabs aren't working properly in the "On This Page" side bar.
⛳️ Current behavior (updates)
When clicking on the anchor links on the right sidebar in the Props and Theming tabs, the view doesn't scroll into the correct section.
After digging into this, here's what I found:
When switching to Props and Theming tabs in the doc, the inner html of the Usage tab gets updated with the data for the Props or Theming tabs
The problem lies in the Component.tsx file. There's a condition in the map iteration that displays children when index === 0 (which is the "Usage" tab), causing unexpected behavior.
🚀 New behavior
To fix this, I've modified the code to remove the MDXContent component from the conditional. This ensures that the "Usage" Tab only receives the doc that corresponds to it.
💣 Is this a breaking change (Yes/No):
NO