0

I'm not sure why I'm getting this error. I'm copying the code directly as is from "Pure React" by Dave Ceddia. I'm working on the github-file-list project.

const FileListItem = ({ file }) => (
    <tr className="file-list-item">
        <FileName file={file} />
        <CommitMessage
            commit={file.lastestCommit} />
    </tr>
);
FileListItem.propTypes = {
    file: PropTypes.object.isRequired
};

const CommitMessage = ({ commit }) => (
    <td className="commit-message">
        {commit.message}
    </td>
); 
CommitMessage.propTypes = {
    commit: PropTypes.object.isRequired
};

const testFiles = [
{
    id: 1,
    name: 'src',
    type: 'folder',
    updated_at: '2016-07-11 21:24:00',
    latestCommit: {
        message: 'Initial commit'
    }
},
{
    id: 2,
    name: 'tests',
    type: 'folder',
    updated_at: "2016-07-11 21:24:00",
    latestCommit: {
        message: 'Initial commit'
    }
}, {
    id: 3,
    name: 'README',
    type: 'file',
    updated_at: "2016-07-18 21:24:00",
    latestCommit: {
        message: 'Added a readme'
    }
},
];

The error points to where I to the CommitMessage component where I declare {commit.message}.

1 Answer 1

1

Probably has something to do with this

const FileListItem = ({ file }) => (
    <tr className="file-list-item">
        <FileName file={file} />
        <CommitMessage
            commit={file.lastestCommit} />
    </tr>
);

lastestCommit, looks like a typo.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.