October 2019
Intermediate to advanced
426 pages
11h 49m
English
Previously, we dispatched a CREATE_POST action when a new post gets created. However, this action does not contain the post id, which means that links to newly created posts will not work.
We are now going to adjust the code to pass the post id to the CREATE_POST action:
import React, { useState, useContext, useEffect } from 'react'
const [ post, createPost ] = useResource(({ title, content, author }) => ({
Read now
Unlock full access