score:1

Accepted answer
class MemberModal extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            firstName: props.selectedmember.firstName
        };
    }

    handleFirstNameChange = e => {
        this.setState({ firstName: e.target.value });
        // Make call to API to save changes here
        User.save({ firstName: e.target.value });
    };

    render() {
        const { firstName } = this.state;
        return (
            <div className="static-modal">
                <input
                    value={firstName}
                    type="text"
                    className="form-control"
                    id="FirstName"
                    aria-describedby="FirstName"
                    placeholder=""
                    name="email"
                    onChange={this.handleFirstNameChange}
                />
            </div>
        );
    }
}

Related Query

More Query from same tag