How to make an active input field by clicking on another element?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
15 views
Good day!

Write a generic TextField component that can be used on the application pages.
Problem: when clicking on the icon of a pencil you need to do is input the active field, i.e. focus.
Decision: to hang the ref input on field ref to make each field unique.
But to me, this solution seems clumsy, maybe there are more concise methods?

Working example: https://codesandbox.io/s/rrjvjy5qp4
by | 15 views

1 Answer

0 like 0 dislike
The decision to put the ref on input field

Good decision.

ref to make each field unique.

It makes no sense. Use one ref in the component TextField in each created instance of a component it will be unique.
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
36,634 users