While developing a Textarea component in React with React-hook-form,
I needed to add two refs to the textarea field but it was a bit uggly so I tried to make that prettier:
Before:
<textarea
ref={e => {
textareaRef.current = e;
registerRef(e);
}}
...
/>
After:
<textarea
ref={e => ((textareaRef.current = e), registerRef(e))}
...
/>
Top comments (0)