Могу ли я использовать autoGrow в избыточной форме? - PullRequest
0 голосов
/ 11 мая 2018

Мне интересно, могу ли я использовать autoGrow в форме редукса или мне следует использовать что-то еще?

Вот мой код рендеринга

const renderField = ({ label, keyboardType, name, meta: { touched, error }, input: {onChange, ...restInput} }) => {
    return (
      <View style={{flexDirection: 'column', height: 70, alignItems: 'flex-start'}}> 
        <View style={{flexDirection: 'row', height: 30, alignItems: 'center', borderColor: 'black', borderBottomWidth: 1,}}> 
            <TextInput style={{ height: 37, width: 280, paddingLeft: 10, fontSize: 20}}
              keyboardType={keyboardType} onChangeText={onChange} {...restInput}
              placeholder={label}
            >
            </TextInput>
        </View>
        {touched && ((error && <Text style={{color: 'red', }}>{error}</Text>))}
      </View>);
  };

1 Ответ

0 голосов
/ 12 мая 2018

Вы можете использовать textArea, чтобы изменить количество строк и расширить текстовую область

const renderTextArea = ({ input, label, className, rows, meta: { touched, error, warning }}) => (
      <div>
        <div>
          <textarea {...input} placeholder={label} rows={rows} cols="100" className={className}/>
          {touched && ((error && <span className="error_field">{error}</span>) || (warning && <span>{warning}</span>))}
        </div>
      </div>
    )
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...