src/entities/InfiniteScrollTrigger/InfiniteScrollTrigger.tsx
last analyzed

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 28
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 21
mnd 0
bc 0
fnc 0
dl 0
loc 28
bpm 0
cpm 0
noi 6
c 0
b 0
f 0
1
import { useRef } from 'react'
2
import { useIntersectionObserver } from 'shared/hooks/useIntersectionObserver'
3
4
interface IProps {
5
  onIntersect: () => void
6
  enabled: boolean
7
}
8
9
const InfiniteScrollTrigger = ({ onIntersect, enabled }: IProps) => {
0 ignored issues
show
introduced by
Function component is not a function declaration
Loading history...
10
  const loadMore = useRef<HTMLDivElement | null>(null)
11
12
  useIntersectionObserver({
13
    target: loadMore,
14
    onIntersect,
15
    enabled,
16
    rootMargin: '2000px',
17
  })
18
19
  return (
20
    <div
0 ignored issues
show
introduced by
Expected indentation of 6 space characters but found 4.
Loading history...
introduced by
JSX not allowed in files with extension '.tsx'
Loading history...
21
      ref={loadMore}
0 ignored issues
show
introduced by
Expected indentation of 8 space characters but found 6.
Loading history...
22
      style={{ background: 'transparent', padding: '20px' }}
0 ignored issues
show
introduced by
Expected indentation of 8 space characters but found 6.
Loading history...
introduced by
JSX attribute values should not contain objects created in the same scope
Loading history...
23
    />
24
  )
25
}
26
27
export { InfiniteScrollTrigger }
28