Skip to content

Commit

Permalink
Added propTypes to TaskList component
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes committed Dec 21, 2023
1 parent 1212e57 commit 429780a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/TaskList.jsx
@@ -1,5 +1,5 @@
import React from "react";

import PropTypes from "prop-types";
import Task from "./Task";

export default function TaskList({ loading, tasks, onPinTask, onArchiveTask }) {
Expand Down Expand Up @@ -51,3 +51,16 @@ export default function TaskList({ loading, tasks, onPinTask, onArchiveTask }) {
</div>
);
}
TaskList.propTypes = {
/** Checks if it's in loading state */
loading: PropTypes.bool,
/** The list of tasks */
tasks: PropTypes.arrayOf(Task.propTypes.task).isRequired,
/** Event to change the task to pinned */
onPinTask: PropTypes.func,
/** Event to change the task to archived */
onArchiveTask: PropTypes.func,
};
TaskList.defaultProps = {
loading: false,
};

0 comments on commit 429780a

Please sign in to comment.