with-data-fetch
v1.17.0
Published
hoc component for data fetching
Downloads
29
Maintainers
Readme
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);