Skip to content

yuemingl/my-react-app-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React example using async fetch to get data

The content of public/data.json is displayed using async fetch

    (async function(dataList) {
      try {
        let response = await fetch('/data.json');
        let json = await response.json();
        dataList.setState({data:json})
      }
      catch(e) {
        console.log('Error!', e);
      }
    })(this);

ScreenShot

About

React example using async to display a list of items

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published