October 2019
Intermediate to advanced
426 pages
11h 49m
English
Next, we need to use the setPosts function in order to insert a new post, when we press the Create button.
Let's start modifying the CreatePost component in order to make it dynamic:
import React, { useState } from 'react'
export default function CreatePost ({ user, posts, setPosts }) {
const [ title, setTitle ] = useState('') const [ content, setContent ] = useState('')
function handleTitle ...
Read now
Unlock full access