saurabhnemade / react-twitter-embed

Simplest way to add twitter widgets to your react project.
https://saurabhnemade.github.io/react-twitter-embed/
363 stars 65 forks source link

TwitterShareButton url prop not working properly #97

Open lucianourgal opened 2 years ago

lucianourgal commented 2 years ago

Hi all,

I've run into two issues with the TwitterShareButton:

Condition:

Condition:

Code as follows:

` import React from "react"; import {TwitterShareButton} from "react-twitter-embed"; import s from "./twitterTweet.scss";

const TwiterTweet: React.FC = ({ text, url, author, buttonSize = "large" }) => { return (

); };

export default TwiterTweet; `

saurabhnemade commented 2 years ago

@lucianourgal on version 4.0.4?

saurabhnemade commented 2 years ago

To avoid re-rendering it was never added even in the previous version (https://github.com/saurabhnemade/react-twitter-embed/blob/example-updated/src/components/TwitterShareButton.js). However if you are still trying to achieve this, you can try like following by adding key:

https://codesandbox.io/s/jolly-wood-is0zk?file=/src/TwiterTweet.js

lucianourgal commented 2 years ago

Thanks for replying @saurabhnemade . I'm actually using v4.0.6.