Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderError not rendering for successive error tweets #41

Open
olayinkasf opened this issue Dec 13, 2020 · 0 comments
Open

renderError not rendering for successive error tweets #41

olayinkasf opened this issue Dec 13, 2020 · 0 comments

Comments

@olayinkasf
Copy link

So I am displaying tweets via next-previous navigation, and I noticed that when we have two successive tweets failing to fetch, the render error is invoked for the first one but there is no error rendered for the second one.

Demo

import React, { useState } from "react";
import "./styles.css";
import { Tweet } from "react-twitter-widgets";

export default function App() {
  const tweets = ["1338166052975497218", "000", "0010", "1337051123799232514"];
  const [index, setIndex] = useState(0);

  return (
    <div className="App">
      <button onClick={() => setIndex((index + 3) % 4)}>previous</button>
      <button onClick={() => setIndex((index + 5) % 4)}>next</button>
      <Tweet
        options={{ width: "120px%", theme: "dark" }}
        renderError={() => "Unable to fetch tweet"}
        tweetId={tweets[index]}
      />
    </div>
  );
}

@olayinkasf olayinkasf changed the title Render error not rendering for successive error tweets renderError not rendering for successive error tweets Dec 13, 2020
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

No branches or pull requests

1 participant