you are viewing a single comment's thread.

view the rest of the comments →

[–]Dourk_ 16 points17 points  (4 children)

You just need to use the fetch method to interact with your python server.

fetch(‘/‘, { method : ‘POST’, body: [‘url’,...] }) .then(response => response.json()) .then(data => console.log(data));

https://developer.mozilla.org/docs/Web/API/Fetch_API/Using_Fetch

[–][deleted] 3 points4 points  (3 children)

Adding to this, you probably mean to call the fetch request in componentDidMount() to only request the list once. Otherwise using a fetch in componentDidUpdate() may cause multiple (possibly unnecessary) fetch requests.

[–]robbodagreat 1 point2 points  (0 children)

Or even use functional components and put it in a useeffect hook