|
|
|
|
|
by seanlaff
914 days ago
|
|
Would we expect the list to re-render once the fetch finishes? This may just be years of react poisoning my brain const Stargazers = () => {
const stargazers = van.state([]);
fetch(`https://api.github.com/repos/vanjs-org/van/stargazers?per_page=5`)
.then((r) => r.json())
.then((r) => stargazers.val = r);
return ul(
stargazers.val.map((s) => li(s.login))
);
};
|
|