Skip to content

guideline-tech/react-promise-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

React Promise Component

A component which enables a function body to be invoked only once the provided promise resolves.

let promise = fetchUserFromStoreOrServer();

<PromiseComponent promise={promise}>
  {
    (error, userData) => {
      if(error) return <p className="error">{error.message}</p>;

      return (
        <UserProfile {...userData} />
      );
    }
  }
</PromiseComponent>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published