Skip to content

Instantly share code, notes, and snippets.

@samipshah100
Created September 26, 2020 10:08
Show Gist options
  • Save samipshah100/112cb49a04527b887f3c73f2cee2f9b6 to your computer and use it in GitHub Desktop.
Save samipshah100/112cb49a04527b887f3c73f2cee2f9b6 to your computer and use it in GitHub Desktop.
import React from 'react'
import {actionCreator} from '../../redux/actionCreators.js'
import { useFetchEffect } from '../../hooks/useFetchEffect'
const AnotherComponent = () => {
const url = 'https://anotherAPIEndpoint.com/route' // sample api
const data = useFetchEffect(actionCreator)
return <div className="AnotherComponent">{data.map(<div>{data.name}</div>)}</div>
}
export default AnotherComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment