首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我可以在redux形式中使用autoGrow吗?

我可以在redux形式中使用autoGrow吗?
EN

Stack Overflow用户
提问于 2018-05-11 08:44:02
回答 1查看 35关注 0票数 1

我想知道我是否可以在redux形式中使用autoGrow,还是应该使用其他东西?

这是我的渲染代码

代码语言:javascript
复制
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>);
  };
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-05-12 14:19:47

可以使用textArea更改行数和展开文本区域。

代码语言:javascript
复制
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>
    )
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50288431

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档