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
Move isRtl
from props to Redux for PersonalRecentProjects
#19608
Conversation
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.
Thank you for converting these components into classes!
|
||
viewAllProjects() { | ||
this.setState({showAll: true, showApp: ''}); | ||
}, | ||
} |
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.
onSelectApp
and viewAllProjects
do not appear to be properly bound to this
here. I believe the preferred syntax is:
onSelectApp = appType => {
this.setState({showAll: false, showApp: appType});
}
@islemaster has done a bunch of these conversions and may be able to offer a second opinion. Here is one very long explanation, or you can skip to the end: http://reactkungfu.com/2015/07/why-and-how-to-bind-methods-in-your-react-component-classes/
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.
Right, good catch! I will fix.
So does this require a parent of https://github.com/code-dot-org/code-dot-org/blob/staging/apps/src/templates/projects/ProjectWidgetWithData.jsx to be connected? Is that currently always true? |
`instance.onSelectApp('playlab');` sets `this` to `instance`, which makes the test unintentionally pass!
It does. All three usages of |
@davidsbailey verified fixed (green-red-green) with a shiny new unit test! |
Thanks for adding these tests! LGTM |
Continue
isRtl
Redux cleanup.