Adding an about description

In order to store the description entered in the about field by a user, we need to add an about field to the user model in server/models/user.model.js:

about: {    type: String,    trim: true  }

Then, to get the description as input from the user, we add a multiline TextField to the EditProfile form and handle the value change the same way we did for the user's name input.

mern-social/client/user/EditProfile.js:

  <TextField      id="multiline-flexible"      label="About"      multiline      rows="2"      value={this.state.about}      onChange={this.handleChange('about')}   />

Finally, to show the description text added to the about field on the user profile page, we can add it to the existing profile view.

mern-social/client/user/Profile.js:

<ListItem> ...

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.