Skip to content

Instantly share code, notes, and snippets.

@dcalixto
Created October 23, 2018 22:12
Show Gist options
  • Save dcalixto/8112eac4f516764a28a24ad084f7e4a0 to your computer and use it in GitHub Desktop.
Save dcalixto/8112eac4f516764a28a24ad084f7e4a0 to your computer and use it in GitHub Desktop.

Revisions

  1. dcalixto created this gist Oct 23, 2018.
    26 changes: 26 additions & 0 deletions comments
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    import React, { Component } from "react";
    import Comment from "./comment";
    class Comments extends Component {
    constructor(props) {
    super(props);
    this.state = {
    comments: []
    };
    }

    render() {
    let { comments, replies } = this.props;

    comments = comments.map(comment => {
    return <Comment comment={comment} key={comment.id} />;
    });

    return (
    <table className="table table-striped">
    <tbody>{comments}</tbody>
    </table>
    );
    }
    }

    export default Comments;