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

Warning: React does not recognize the allowTransparency prop on a DOM element. #165

Closed
tyteen4a03 opened this issue Jun 19, 2020 · 8 comments
Labels
question Further information is requested

Comments

@tyteen4a03
Copy link

tyteen4a03 commented Jun 19, 2020

Expected Behavior

With the codesandbox setup, it should pass through allowTransparency through for the <a> element.

Actual Behavior

React shows an error message instead.

Steps to Reproduce

See demo

Reproducible Demo

https://codesandbox.io/s/html-react-parser-w4eg2

Environment

  • Version: 0.13.0
  • Platform: macOS 10.15.5
  • Browser: FF 77
@remarkablemark
Copy link
Owner

I believe allowTransparency can only be used for the <iframe> element.

Are you unable to use style="background-color: transparent;"? See CodeSandbox.

Also, the htmlparser2 option is only works on Node.js (server-side) and does not work on the browser (client-side). I'll need to update the README.md if it wasn't clear.

@remarkablemark remarkablemark added the question Further information is requested label Jun 20, 2020
@tyteen4a03
Copy link
Author

tyteen4a03 commented Jun 20, 2020

I quickly modified the codesandbox to show the issue because I expect this bug may be applicable to any attributes for any tags; my original code uses allowTransparency on an <iframe>.

@remarkablemark
Copy link
Owner

I see. I'll take a look at this but given that this is a warning, I'll assume nothing's broken. Is that correct?

@tyteen4a03
Copy link
Author

tyteen4a03 commented Jun 20, 2020

Yeah I don't think anything broke, but I didn't check SSR.

@remarkablemark
Copy link
Owner

So I did some research and it seems like allowtransparency on the iframe is obsolete. See mdo/github-buttons#60

@tyteen4a03
Copy link
Author

tyteen4a03 commented Jun 20, 2020

It might be obsolete in W3C's eyes but the <iframe> generation codes for Facebook definitely still uses it.

@remarkablemark
Copy link
Owner

Makes sense. Feel free to open a PR if you think you can fix it.

@remarkablemark
Copy link
Owner

Closing issue due to inactivity.

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

No branches or pull requests

2 participants