Skip to content

Refs Warning#72

Open
pmilla1606 wants to merge 1 commit into
saurabhnemade:masterfrom
pmilla1606:refs_bug_fix
Open

Refs Warning#72
pmilla1606 wants to merge 1 commit into
saurabhnemade:masterfrom
pmilla1606:refs_bug_fix

Conversation

@pmilla1606

Copy link
Copy Markdown

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 }

Copy link
Copy Markdown

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
Copy Markdown

merge please @saurabhnemade

@pepadom

pepadom commented Apr 20, 2021

Copy link
Copy Markdown

can we merge please? - thank you! @saurabhnemade

@appukuttan-shailesh

Copy link
Copy Markdown

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