diff --git a/snippets/LimitedWordTextArea.md b/snippets/LimitedWordTextArea.md new file mode 100644 index 000000000..662ec93dd --- /dev/null +++ b/snippets/LimitedWordTextArea.md @@ -0,0 +1,62 @@ +### LimitedWordTextArea + +Renders a textarea component with a word limit. + +Use the value of the `value` prop to determine the initial `state.content` and `state.wordCount` and the value of the `limit` props to determine the value of `state.limit`. +Create a method, `handleChange`, which trims the `event.target.value` data if necessary and uses `Component.prototype.setState` to update `state.content` and `state.wordCount`, and bind it to the component's context. +In the`render()` method, use a`