New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PropTypes Error Create New Post Page #14969
Conversation
|
Thank you for opening this PR! We appreciate you! For all pull requests coming from third-party forks we will need to A Forem Team member will review this contribution and get back to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I've left a couple of suggestions, but they're not blocking. I also noticed that if you're a member of an organization, there are still a few PropTypes errors being logged out on this page.
It can always be tackled separately, so I'll leave it up to you whether to tackle those errors here too.
Thanks for tidying up these errors! 🧹 ✨
| @@ -65,7 +65,7 @@ export class ArticleForm extends Component { | |||
| }; | |||
|
|
|||
| static defaultProps = { | |||
| organizations: '', | |||
| organizations: '[]', | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is needed - I can't see any error being flagged for the current default prop?
| @@ -24,7 +24,7 @@ export const ErrorList = ({ errors }) => { | |||
| }; | |||
|
|
|||
| ErrorList.propTypes = { | |||
| errors: PropTypes.objectOf(PropTypes.string).isRequired, | |||
| errors: PropTypes.object.isRequired, | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| errors: PropTypes.object.isRequired, | |
| errors: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).isRequired |
suggestion (not blocking) - we could make these even more specific, since we know the object values should all be arrays of strings
| * @param {boolean} props.previewShowing Boolean to decide if to show the preview | ||
| * @param {string} props.helpFor Section for which help is shown | ||
| * @param {string} props.helpPosition Offset from the top of the help component | ||
| * @param {number} props.helpPosition Offset from the top of the help component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
What type of PR is this? (check all applicable)
Description
Fixes PropTypes error in Create new post page
Related Tickets & Documents
#14837
Added/updated tests?
[optional] What gif best describes this PR or how it makes you feel?