user1017674 user1017674 - 1 year ago 115
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?

Answer Source

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'/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download