October 2019
Intermediate to advanced
426 pages
11h 49m
English
The CreatePost component uses two input fields: one for the title, and one for the content. We are going to replace both of them with Input Hooks.
Let's implement Input Hooks in the CreatePost component now:
import { useInput } from 'react-hookedup'
const [ title, setTitle ] = useState('') const [ content, setContent ] = useState('')
We replace them with the corresponding Input Hooks:
const { value: title, bindToInput: bindTitle } = useInput('') const { value: content, bindToInput: bindContent } = useInput('')
function handleTitle ...
Read now
Unlock full access