Skip to content

Commit

Permalink
make num of rows in example equal (#2226)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonvisscher authored and jaredpalmer committed Jan 24, 2020
1 parent 80f153f commit a41458a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ const MyStyledTextarea = MyStyledInput.withComponent('textarea');
<Field name="website" as={MyStyledInput} placeHolder="google.com"/>

// <textarea placeHolder="Post a message..." rows={5}></textarea>
<Field name="message" as={MyStyledTextArea} placeHolder="Post a message.." rows={4}/>
<Field name="message" as={MyStyledTextArea} placeHolder="Post a message.." rows={5}/>
```
React is all about composition, and while we've cut down on a lot of the prop-drilling, we are still repeating ourselves with a `label`, `<Field>`, and `<ErrorMessage>` for each of our inputs. We can do better with an abstraction! With Formik, you can and should build reusable input primitive components that you can share around your application. Turns out our `<Field>` render-prop component has a sister and her name is `useField` that's going to do the same thing, but via React Hooks! Check this out...
Expand Down

0 comments on commit a41458a

Please sign in to comment.