-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlint_errors.txt
More file actions
28 lines (20 loc) · 2.86 KB
/
Copy pathlint_errors.txt
File metadata and controls
28 lines (20 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
> devhack-3.0@3.0.4 lint
> eslint .
D:\dsu devhack\3.0\dev3.0\src\sections\Footer.tsx
53:9 error Expected an assignment or function call and instead saw an expression @typescript-eslint/no-unused-expressions
D:\dsu devhack\3.0\dev3.0\src\sections\Timeline.tsx
356:5 error Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
D:\dsu devhack\3.0\dev3.0\src\sections\Timeline.tsx:356:5
354 | useEffect(() => {
355 | window.addEventListener("scroll", handleScroll, { passive: true });
> 356 | handleScroll();
| ^^^^^^^^^^^^ Avoid calling setState() directly within an effect
357 | return () => window.removeEventListener("scroll", handleScroll);
358 | }, [handleScroll]);
359 | react-hooks/set-state-in-effect
Γ£û 2 problems (2 errors, 0 warnings)