mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
observer.disconnect when unmount
This commit is contained in:
parent
666b6b2817
commit
1b085aabd6
@ -1,6 +1,5 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import classnames from "classnames"
|
import classnames from "classnames"
|
||||||
import IntersectionObserver from "intersection-observer-polyfill"
|
|
||||||
|
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
|
|
||||||
@ -36,6 +35,7 @@ export default React.forwardRef((props, ref) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
observer.disconnect()
|
||||||
observer = null
|
observer = null
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user