Last active
July 4, 2019 19:14
-
-
Save icarus-sullivan/58a3c8e17bf5696df9d8434c17a5fef7 to your computer and use it in GitHub Desktop.
Consuming HOC withAysnc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import PageFetch from './PageFetch'; | |
const Example = (props) => { | |
const [url, setUrl] = useState('https://www.npmjs.com/package/@sullivan/use-async'); | |
return ( | |
<div> | |
<div>Libraries</div> | |
<select value={url} onChange={(e) => setUrl(e.target.value)}> | |
<option value="https://www.npmjs.com/package/@sullivan/use-async">useAsync</option> | |
<option value="https://www.npmjs.com/package/react-spinner-material">Spinner</option> | |
<option value="https://www.npmjs.com/package/serverless-plugin-flambe">Flambe</option> | |
</select> | |
<PageFetch args={[url]} /> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment