Skip to content

Add as prop for renaming HTML tag #269

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

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

devinschulz
Copy link
Contributor

In some cases, when using the skeleton loader within a p tag, React will log this warning:

console.error
    Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.
        at div
        at SkeletonLoader (/node_modules/tiny-skeleton-loader-react/src/index.tsx:16:3)
        at div
        at p

I propose allowing developers to rename the div by the as prop, like so:

<SkeletonLoader as="span" />

@harshzalavadiya harshzalavadiya merged commit c93a249 into hc-oss:master Sep 8, 2022
@devinschulz devinschulz deleted the rename-html-tag branch September 8, 2022 17:12
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.

2 participants