小编sta*_*taz的帖子

How to make input field editable that has a value in reactjs?

I'm new to Reactjs and I'm having difficulty in making the input field that has a assign value. Please guys help me.

My js file.

       <div className="col-sm-9">
        <input className={this.state.editable ? "edit-profile" : "disable-profile disable"}
        ref="fullName"
        onChange={this._handleInputChange.bind(null, "fullName")}
                        value={user.fullName}/>
Run Code Online (Sandbox Code Playgroud)

My button

<button className="btn btn-default" onClick={this.edit}>
    {this.state.editDone ? "Done" : "Edit Profile"}</button>

edit = () => {
    if (!this.state.editDone) {
        this.setState({ editable: true, editDone: true});
    } else {
        this.setState({ editable: false, editDone: false});
    }
}
Run Code Online (Sandbox Code Playgroud)

css file

.edit-profile {
outline: 0;
color: …
Run Code Online (Sandbox Code Playgroud)

css input reactjs

4
推荐指数
1
解决办法
5321
查看次数

npm run android 在 Windows 10 中不起作用

我是 React Native 编程的新手。我在 Android 手机上运行我的应用程序有困难,因为我的 npm run android 不工作。

命令结果图片

我该怎么办?

cmd npm reactjs react-native

3
推荐指数
1
解决办法
9557
查看次数

标签 统计

reactjs ×2

cmd ×1

css ×1

input ×1

npm ×1

react-native ×1