Skip to content

Commit

Permalink
feat: update check in CodeTabs so it works with MDX v2 output (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryce Kalow committed Nov 29, 2021
1 parent 80e1b0b commit e8d741e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wicked-years-clean.md
@@ -0,0 +1,5 @@
---
'@hashicorp/react-code-block': minor
---

Update CodeTabs to identify nodes rendered through MDX v2
8 changes: 7 additions & 1 deletion packages/code-block/partials/code-tabs/index.js
Expand Up @@ -33,7 +33,13 @@ function CodeTabs({ children, heading, className, tabs, theme = 'dark' }) {
type = tabChild.props.mdxType
return type
})
const validTypes = ['CodeBlock', 'CodeBlockConfig', 'pre']
const validTypes = [
'CodeBlock',
'CodeBlockConfig',
'pre',
'themedCodeBlockConfig',
'themedPre',
]
const unexpectedChildren = childTypes.filter((type) => {
const isInvalidType = validTypes.indexOf(type) === -1
return isInvalidType
Expand Down

1 comment on commit e8d741e

@vercel
Copy link

@vercel vercel bot commented on e8d741e Nov 29, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.