Last active
June 22, 2021 16:28
-
-
Save starkraving/6c7dd79711f6198870dcf4516fab6eab to your computer and use it in GitHub Desktop.
Using label for focus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Component1 = () => ( | |
<div className='col-sm-2 col-xs-12 p-2 border border-primary'> | |
<label for='myinput' className='btn btn-primary'> | |
Click to focus | |
</label> | |
</div> | |
); | |
const Component2 = () => ( | |
<div className='col-sm-10 col-xs-12 p-2 border border-primary'> | |
<input id='myinput' type='text' className='form-control' /> | |
</div> | |
); | |
export default function App() { | |
return ( | |
<div className='container'> | |
<h1 className='text-center'>Label for Focus</h1> | |
<div className='row'> | |
<Component1 /> | |
<Component2 /> | |
</div> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment