Skip to content

Conversation

@pmilla1606
Copy link

Updates refs to use createRef in order to silence the following warning:

Warning: A string ref, "embedContainer", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead.

buildOptions() {
let options = Object.assign({}, this.props.options)
if (this.props.autoHeight) { options.height = this.refs.embedContainer.parentNode.offsetHeight }
if (this.props.autoHeight) { options.height = this.embedContainer.parentNode.offsetHeight }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.props.autoHeight) { options.height = this.embedContainer.parentNode.offsetHeight }
if (this.props.autoHeight) { options.height = this.embedContainer.current.parentNode.offsetHeight }

@falsepopsky
Copy link

merge please @saurabhnemade

@pepadom
Copy link

pepadom commented Apr 20, 2021

can we merge please? - thank you! @saurabhnemade

@appukuttan-shailesh
Copy link

Can we please merge this @saurabhnemade ?

jlarmstrongiv added a commit to jlarmstrongiv/react-twitter-embed that referenced this pull request Sep 18, 2021
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.

5 participants