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

Add tag prop to render non-span html elements #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pdxbmw
Copy link

@pdxbmw pdxbmw commented Jun 3, 2020

This PR creates a prop tag, which adds the ability to define the type of HTML element to render. Alternatively, by making the prop falsy, the component can render text-only.

In my case, I'm using the <Pluralize /> component in a SVG text tag, which doesn't accept span as a child element. With this change, I can either use an acceptable a tag or no element at all.

Note: span is still used by default so this shouldn't affect current users.

@pdxbmw
Copy link
Author

pdxbmw commented Jun 3, 2020

My linter added semicolons. Please let me know if you need these removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant