Skip to content
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

Rendering components with a number in the name fail silently #226

Closed
brunolemos opened this issue Aug 14, 2018 · 3 comments
Closed

Rendering components with a number in the name fail silently #226

brunolemos opened this issue Aug 14, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@brunolemos
Copy link

Bug Report

Describe the bug

If you import like this: import { H1 } from './H1' and try to render <H1>Title</H1>, it won't render anything and won't show any error.

If you remove the number like this import { H1 as HH } from './HH' and try to render <HH>Title</HH>, it renders correctly.

Maybe it's a bug in mdx itself?

To Reproduce

---
name: Typography
---

import { H1 } from './H1'

# H1

<H1>Title example</H1>
export const H1 = props => (
  <Text
    {...props}
  />
)

In order to allow us to quickly reproduce you issue please include a link to a reproduction repository.

Expected behavior

Render component normally or at least show an error message about the limitation

Environment

  • OS: macOS 10.14
  • Node/npm version: Node 8/npm 5

Additional context/Screenshots

image

image

image

@brunolemos brunolemos changed the title Importing components with a number in the name fail silently Rendering components with a number in the name fail silently Aug 14, 2018
@pedronauck pedronauck added the bug Something isn't working label Aug 16, 2018
@pedronauck
Copy link
Member

pedronauck commented Sep 7, 2018

For sure @brunolemos, I tried to debug to see if something related to docz, but I think that this is a bug related to the mdx parser 😕

@mzedeler
Copy link

mzedeler commented Sep 7, 2018

It probably is, but can we at least find out if the mdx parser project has registered it and then reference it here?

@rupification
Copy link

took a while for me to figure it out as well as it is weird.
this is my work around for now.. if you need to use it in the MD then use as and rename it. For actual example usage just use <Playground/> no issues.

import { Playground, Props } from 'docz'
import { H1 } from './index'
import { H1 as HeadingOne } from './index'
import Text from '../text'

# Heading

Hello there
<HeadingOne>This is H1 heading</HeadingOne>

## Basic usage
<Playground>
<H1>This is H1 heading</H1>
</Playground>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants