-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
🐛 type/bugThis is a problemThis is a problem
Description
Subject of the issue
Shortcodes breaks if same component if used more than once. We probably want to add a check if the makeShortcode is already added or not.
Your environment
@mdx-js/mdx@1.0.2
@mdx-js/react@1.0.2
Steps to reproduce
<Foo bg='red'>
<Bar>hi</Bar>
{hello}
{/* another commment */}
</Foo>
<Foo bg='red'>
<Bar>hi</Bar>
</Foo>
Expected behaviour
Should work without errors
Actual behaviour
SyntaxError: unknown: Identifier 'Foo' has already been declared (17:6)
15 | const Foo = makeShortcode("Foo");
16 | const Bar = makeShortcode("Bar");
> 17 | const Foo = makeShortcode("Foo");
| ^
18 | const Bar = makeShortcode("Bar");
19 | const layoutProps = {
20 | foo
Metadata
Metadata
Assignees
Labels
🐛 type/bugThis is a problemThis is a problem