Skip to content

Instantly share code, notes, and snippets.

View mkrishnan-codes's full-sized avatar
:atom:

Manu Krishnan mkrishnan-codes

:atom:
View GitHub Profile
@kjmczk
kjmczk / BookContext.js
Created February 12, 2020 11:38
Fetching API data with React Hooks - Build a React App using Basic Hooks
const BookContextProvider = ({ children }) => {
// ...
// add
const getBooks = async () => {
const res = await fetch(
'https://jsonplaceholder.typicode.com/posts?_start=2&_limit=5'
);
const data = await res.json();