MCPcopy
hub / github.com/pmndrs/react-spring / onEnter

Function onEnter

packages/core/src/hooks/useInView.ts:69–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67 const activeIntersections = new WeakMap<Element, VoidFunction>()
68
69 const onEnter = () => {
70 if (to) {
71 // @ts-expect-error – TODO: fix this type error
72 api.start(to)
73 }
74
75 setIsInView(true)
76
77 const cleanup = () => {
78 if (from) {
79 api.start(from)
80 }
81 setIsInView(false)
82 }
83
84 return once ? undefined : cleanup
85 }
86
87 const handleIntersection: IntersectionObserverCallback = entries => {
88 entries.forEach(entry => {

Callers 1

handleIntersectionFunction · 0.85

Calls 1

startMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…