Reactjs and making continuous api calls

Viewed 1082

I am building a react app that contains sports information and therefore I need to fetch new data from the API, every few seconds. I was wondering the best way to go about that.

class App extends Component {
  constructor(props) {
    super(props);


    this.state = {
      PlayersbyTeam: ''
    }

  }

  componentDidMount(){

    this.callAxios()
  }


  callAxios(){
     axios.all([
            axios.get('https://api')
        ])
            .then(axios.spread((x) => {


     }))
  }



  render() {
    console.log(this.state)
    return (
      <div className="App">
          <Table  />
      </div>
    );
  }
} 
0 Answers
Related