robbestad / react-iframe

Simple solution for using iframes in React
ISC License
436 stars 79 forks source link

How to set styles to component? #5

Closed Sunil6591 closed 7 years ago

Sunil6591 commented 8 years ago

I am trying to set

<IFrame style={{position: 'fixed', width: '100%', height: '100%', left: 0}} url={...}  />

But its not applying

smhatre59 commented 7 years ago

The code used internally is : React.createElement("iframe", { ref: "iframe", style: { position: this.props.position, height: this.props.height, width: this.props.width }, height: this.props.height, width: this.props.width });

So you can set width and height using props as follows: <Iframe url={embedUrl} height="500" width="600"/>

robbestad commented 7 years ago

Yep, that works, but I guess if you want more styles then that is not enough. Added a styles prop now!