in React JS by
Q:

How to use React label element?

1 Answer

0 votes
by

If you try to render a <label> element bound to a text input using the standard for attribute, then it produces HTML missing that attribute and prints a warning to the console.

<label for={'user'}>{'User'}</label>
<input type={'text'} id={'user'} />

Since for is a reserved keyword in JavaScript, use htmlFor instead.

<label htmlFor={'user'}>{'User'}</label>
<input type={'text'} id={'user'} />
Click here to read more about React JS
Click here to read more about Insurance

Related questions

0 votes
0 votes
asked Mar 3, 2020 in React JS by miceperry
0 votes
asked Mar 2, 2020 in React JS by RShastri
0 votes
asked Mar 2, 2020 in React JS by RShastri
0 votes
asked Jan 31 in React JS by Robindeniel
0 votes
asked Mar 4, 2020 in React JS by JackTerrance
...