How will I get a textboxes values in react js
You can solve your problem 2 ways:
First, you can create 2 seperate onChange methods to update your username/password state
or, even better : add name tag to your form inputs:
name = userName
in your username input and
name = password
for password input.
Then make a method that triggers after onChange Event
function example(e){
this.setState({
[e.target.name] : [e.target.value]
})
}
Make sure that names of your username and password forms are the same as attributes in your state.