Skip to content

hoc component with ability to fetch data from a server

Notifications You must be signed in to change notification settings

golovewkin/with-data-fetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

with-data-fetch

A custom React hoc for data fetching.

Install

npm i with-data-fetch

Usage

import React from 'react';
import withDataFetch from 'mine';

const AppWrapper = () => {
  const getData = React.useCallback(() => {
    return ['my data']
  }, []);
  
  return <App />
}

const App = ({data}) => {
  return <span>{JSON.stringify(data)}</span>
};


export default withDataFetch(AppWrapper);

About

hoc component with ability to fetch data from a server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published