Skip to content

Commit 5b02819

Browse files
committed
move local storage access out of filter function
1 parent df58082 commit 5b02819

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Table/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const Table = () => {
5555
}
5656

5757
const filteredByCheckbox = () => {
58+
const checkbox = localStorage.getItem('checkbox') || '';
5859
return questions.filter(question => {
59-
const checkbox = localStorage.getItem('checkbox') || '';
6060
if (!checkbox) return true;
6161
return question.checkbox === checkbox;
6262
});

0 commit comments

Comments
 (0)