--- title: Textarea with character limit type: snippet tags: [components,state,callback,event] cover: flower-portrait-2 dateModified: 2021-10-13T19:29:39+02:00 --- Renders a textarea component with a character limit. - Use the `useState()` hook to create the `content` state variable. Set its value to that of `value` prop, trimmed down to `limit` characters. - Create a method `setFormattedContent`, which trims the content down to `limit` characters and memoize it, using the `useCallback()` hook. - Bind the `onChange` event of the `