React-native-elements: Component Input displayError was removed

Created on 9 Apr 2018  路  3Comments  路  Source: react-native-elements/react-native-elements

Description

  1. Explain what you did

    • Updated to beta4

  2. What you expected to happen

    • Nothing because the components I use aren't referenced in the Release Notes

  3. What actually happens

    • You deleted the displayError property from the Input Component now it always shows the Error message.

Also please include the version of react-native-elements that you are using.
1.0.0-beta4

Solution

use

<Input
    secureTextEntry={secureTextEntry}
    placeholder={placeholder}
    value={(secureTextEntry ? null : (value === '') ? null : value)}
    containerStyle={{marginRight: 15, borderColor: '#ddd'}}
    onChangeText={text => onChangeText(name, text)}
    errorStyle={(displayError) ? errorStyle : null}
    errorMessage={(displayError) ? errorMessage : null}
/>

instead of:

<Input
    secureTextEntry={secureTextEntry}
    placeholder={placeholder}
    value={(secureTextEntry ? null : (value === '') ? null : value)}
    onChangeText={text => onChangeText(name, text)}
    displayError={displayError}
    errorStyle={errorStyle}
    errorMessage={errorMessage}
/>

or add it again xD

Most helpful comment

@Tonacatecuhtli You鈥檙e right we missed that in the release notes ! We added the a label feature + removed displayError. Will add that

All 3 comments

Come on, you could just add :

{ displayError && <Text style={errorStyle}> {errorMessage} </Text> }

馃槄

I know that's why I added the solution xD but yours is more to the point.

@Tonacatecuhtli You鈥檙e right we missed that in the release notes ! We added the a label feature + removed displayError. Will add that

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jackcbrown89 picture jackcbrown89  路  3Comments

pacozaa picture pacozaa  路  3Comments

mikebski picture mikebski  路  3Comments

ilkerceng picture ilkerceng  路  3Comments

hazmah0 picture hazmah0  路  3Comments