npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

'styles' prop not working for react-iframe

What I Wanted to Do

I want to use the styles prop.
I followed the documentation here:

What Happened Instead

I get this Warning instead: Warning: Unknown prop styles on <iframe> tag. Remove this prop from the element. For details, see

Reproduction Steps

(You might get an answer here, but because this forum is focused on npm, you might want to ask your question somewhere that targets experts with your package. I have moved your topic to #community:javascript)

You could also try asking at:

I don’t see the warning on, is it visible only on an actual project running directly on the browser? Also, I think you should init the state as follows:

constructor(props) {
  this.state = {
    iFrameWidth: document.documentElement.clientWidth,
    iFrameHeight: document.documentElement.clientHeight