We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 813799e commit fb043a8Copy full SHA for fb043a8
courses/advanced-hooks/02-imperative-react/exercise/TwitterFeed.js
@@ -10,13 +10,13 @@ function Tweet({ id }) {
10
}
11
12
let script = document.createElement('script')
13
- // When this script runs from twitter, they'll establish a window.twttr variable
14
script.setAttribute('src', '//platform.twitter.com/widgets.js')
15
document.body.appendChild(script)
+ // When this script arrives and loads, they'll establish `window.twttr`
16
script.onload = () => {
17
renderTweet()
18
19
- }, [])
+ }, [id])
20
21
return <div ref={tweetRef} />
22
0 commit comments