Answer the question
In order to leave comments, you need to log in
How to make the correct checkbox filter logic?
Dear programmers need help to make correct CODE
filter logic
Answer the question
In order to leave comments, you need to log in
Yes, everything is already done. You just need to cut out the excess. Why does the SidebarItem component pull something from redux? No need. Its task is to show the checkbox in the specified state, set the event handler passed from the parent. Everything:
export default ({ filter, checked, onChange, children }) => (
<div>
<label>
<input
type="checkbox"
name={filter}
onChange={() => onChange(filter)}
checked={checked}
/>
{children}
</label>
</div>
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question