-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
docs(tabs): add example CodeSnippet via renderContent to story #5258
docs(tabs): add example CodeSnippet via renderContent to story #5258
Conversation
Deploy preview for carbon-elements ready! Built with commit cfdba7b |
Deploy preview for carbon-components-react failed. Built with commit cfdba7b https://app.netlify.com/sites/carbon-components-react/deploys/5e38db1eaf4e6c0008a34816 |
Deploy preview for carbon-elements ready! Built with commit 2b9e4e6 |
Deploy preview for carbon-components-react ready! Built with commit 2b9e4e6 https://deploy-preview-5258--carbon-components-react.netlify.com |
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.
Tiny styling issue, but other than that looks great! Thanks for taking the time to fix the issue 👍 ✅
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.
Hey @emyarod what indentation did you have in mind? This is what it looks like in my IDE so I'm not sure what should be adjusted? |
@jendowns in code it would look similar to https://github.com/carbon-design-system/carbon/blob/master/packages/react/src/components/CodeSnippet/CodeSnippet-story.js#L127-L147. my screenshot is of the output in storybook even though it's weird in the editor, in storybook the |
I'm not sure what the significance of the indentation is in this specific context, but either way: I copied the formatting of the indentation in the |
Closes #5257
Originally I thought the best way to go about solving #5257 was to use the
selected
prop to force a rerender, but then I noticed that the storybook already had an example of that EXACT solution usingrenderContent
Anyway I think it would be beneficial to include a multi-line
CodeSnippet
example withrenderContent
in theTabs
story, to demonstrate how to force a rerender when aTab
is selected for tricky content that relies on refs etc.Also, please let me know if you'd like me to add any notes on the uses of
renderContent
in this context 👍 (EDIT: I did add a little note to the example though)Changelog
New
CodeSnippet
example to demonstrate how to userenderContent
to force a rerender of tab contentChanged
min-height
, so that the code snippet doesn't look weird when expanded in the example.