-
Notifications
You must be signed in to change notification settings - Fork 4
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
Nn 1452 location filter #204
Conversation
event.preventDefault() | ||
const { showFilters } = this.state | ||
this.setState({ | ||
showFilters: !showFilters, |
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.
According to the react docs you should use a different version of setState if you're referring to the current state.
this.setState((state) => { showFilters: !state.showFilters }
<div className="pure-u-md-1-4 padding-top padding-bottom-large padding-left">{genderSelect}</div> | ||
<div> | ||
<a className="clear-filters link clickable" {...linkOnClick(clearFilters)}> | ||
Clear filters |
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.
How about making the clear filters link a component? If you did that it would encapsulate the props that you're supplying using a function. Then there'd be no need to put a 'linkOnClick' function in utils.js.
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.
Hi Lucy. See comments on PR for one suggested and one recommended (by React) change. I've approved the PR - so you can make the changes after merging if you prefer.
No description provided.