react-twitter-embed icon indicating copy to clipboard operation
react-twitter-embed copied to clipboard

Passing handle as prop from parent state doesn't re-render

Open Datagrdn opened this issue 4 years ago • 1 comments

Hey there,

I'm passing the user name from the parent state, but updating that state doesn't trigger a re-render of the TimelineEmbed component:

<TwitterTimelineEmbed
sourceType="profile"
screenName={handle}
options={{height: 700}}
/>

Is there something I'm missing?

Thanks!

Datagrdn avatar Aug 20 '20 21:08 Datagrdn

Adding key={handle} to the component will resolve this issue.

rajat-np avatar Sep 01 '20 06:09 rajat-np