October 2019
Intermediate to advanced
426 pages
11h 49m
English
Finally, we are going to replace all debounced undo logic in the src/post/CreatePost.js file with our custom useDebouncedUndo Hook. Doing so will make our component code much cleaner and easier to read. Furthermore, we can reuse the same debounced undo functionality in other components later.
Let's get started using the Debounced Undo Hook in the CreatePost component by following these steps:
import { useUserState, useDispatch, useDebouncedUndo, useAPICreatePost } from '../hooks'
const [ content, setInput ] = useState('') const [ undoContent, { set: setContent, undo, redo, ...Read now
Unlock full access