user1017674 user1017674 - 3 months ago 21
React JSX Question

Native base dynamically show success or Error input

I want to have two simple input boxes.

There is a loginName input box, and a password input box.

Currently I map the value of these two input box into a "state".

Now, using NativeBase. How do I dynamically show "success" "error" like how they did in the demo?


Passing a prop success is equivalent to passing success={true}

So if you have state variables like inputSuccess and inputError, you can do this:

  success={this.state.inputSuccess ? true : false} 
  error={this.state.inputError ? true : false}>
  <Icon name='ios-checkmark-circle' style={{color:'#00C497'}}/>
  <Input placeholder='Textbox'/>