Adding key to comment-node to not clear out form. Fixes #588

This commit is contained in:
Dessalines 2020-03-09 21:38:10 -04:00
parent 43cbc3de1f
commit ff6462cc02
2 changed files with 2 additions and 1 deletions

View file

@ -38,6 +38,7 @@ export class CommentNodes extends Component<
<div className="comments">
{this.sorter().map(node => (
<CommentNode
key={node.comment.id}
node={node}
noIndent={this.props.noIndent}
viewOnly={this.props.viewOnly}

View file

@ -300,7 +300,7 @@ export class Post extends Component<any, PostState> {
i.setState(i.state);
}
private buildCommentsTree(): Array<CommentNodeI> {
buildCommentsTree(): Array<CommentNodeI> {
let map = new Map<number, CommentNodeI>();
for (let comment of this.state.comments) {
let node: CommentNodeI = {