October 2019
Intermediate to advanced
426 pages
11h 49m
English
Now that we have a good grasp on how to request data from an API, we are going to use the useResource Hook for the creation of new data.
Let's get started implementing post creation using the Resource Hook:
import { useResource } from 'react-request-hook'
const [ , createPost ] = useResource(({ title, content, author }) => ({ url: '/posts', method: 'post', data: { title, content, author } }))
Read now
Unlock full access