Skip to content

Commit

Permalink
Merge pull request chromaui#98 from calaway/fix-add-proptypes-to-task…
Browse files Browse the repository at this point in the history
…-snippet

Fix export to match commit on sample github repo
  • Loading branch information
tmeasday committed Jun 4, 2019
2 parents a71661c + 6e84201 commit 0210847
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions content/react/en/simple-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ It’s best practice to use `propTypes` in React to specify the shape of data th
import React from 'react';
import PropTypes from 'prop-types';

function Task() {
...
export default function Task({ task: { id, title, state }, onArchiveTask, onPinTask }) {
// ...
}

Task.propTypes = {
Expand All @@ -185,8 +185,6 @@ Task.propTypes = {
onArchiveTask: PropTypes.func,
onPinTask: PropTypes.func,
};

export default Task;
```

Now a warning in development will appear if the Task component is misused.
Expand Down

0 comments on commit 0210847

Please sign in to comment.