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

Make `EmojiProps` interface an extension of `HTMLSpanElement` #3

Closed
bdbaraban opened this issue Aug 24, 2019 · 1 comment

Comments

@bdbaraban
Copy link

@bdbaraban bdbaraban commented Aug 24, 2019

I believe the EmojiProps interface should extend the HTMLSpanElement type. That way, additional <span> attributes can be directly passed as props to the Emoji component without raising type errors in TypeScript.

Recommendation:

interface EmojiProps extends React.HTMLAttributes<HTMLSpanElement> {
  label?: string;
  symbol: string;
}

Safely permits usage such as:

<Emoji label="dog" symbol="🐕" className="className" />
@SeanMcP

This comment has been minimized.

Copy link
Owner

@SeanMcP SeanMcP commented Sep 4, 2019

That's a great suggestion, @bdbaraban! Are you interested in making the pull request?

@SeanMcP SeanMcP added this to To do in v1.1 via automation Sep 4, 2019
@SeanMcP SeanMcP closed this in dc4cd0c Sep 5, 2019
v1.1 automation moved this from To do to Done Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
v1.1
  
Done
2 participants
You can’t perform that action at this time.