DEV Community

Discussion on: Learn React Hook by building a Simple Blog App

kmert10 profile image
Mert Karakas

Great article. Just some feedback, there are some typos with your code and your descriptions. One example is:

const [allPosts, setAllPosts] = useState([]);

After that, we'll create a new function called savePost:
const savePost = () => {
    const id =;
    setAllPost([...allPost, {title, content, id}]);
Enter fullscreen mode Exit fullscreen mode