-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rewriting of components for custom elements
This commit particularly solves elements names that include dashes: custom elements, such as `custom-element-name`. These can be written in JSX like so: ```jsx <custom-element-name /> ``` …which is fine. But to support passing them in, we were previously rewriting such code to a member id, to take a key from an object, like so: ```jsx <_components.custom-element-name> ``` …which crashed. This commit solves that by taking the component from the object in a temporary variable, and using that valid variable name as a single component name. ```js const _component0 = _components['custom-element-name'] <_component0 /> ``` Closes GH-2100. Closes GH-2101. Co-authored-by: Titus Wormer <tituswormer@gmail.com> Reviewed-by: Titus Wormer <tituswormer@gmail.com>
- Loading branch information
1 parent
69a15b7
commit 9904838
Showing
2 changed files
with
46 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9904838
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.
Successfully deployed to the following URLs:
mdx – ./
mdx-mdx.vercel.app
mdx-git-main-mdx.vercel.app
v2.mdxjs.com
mdxjs.com