Now that we're done with the article list, it's time to think about the form controls used to add a new article. Let's implement a component for this aspect of the feature:
import React, { Component } from "react";
export default class AddArticle extends Component {
render() {
const {
name,
title,
summary,
onChangeTitle,
onChangeSummary,
onClickAdd
} = this.props;
return (
<section>
<h1>{name}</h1>
<input placeholder="Title" value={title} onChange={onChangeTitle}
/>
<input
placeholder="Summary"
value={summary}
onChange={onChangeSummary}
/>
<button onClick={onClickAdd}>Add</button>
</section>
);
}
}
Now, our feature component only needs to render <AddArticle> and <ArticleList> components:
render() {
const { articles, title...