mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
chore: remove log
This commit is contained in:
parent
38c69bbfdf
commit
9d50e1393b
1 changed files with 7 additions and 10 deletions
|
|
@ -24,16 +24,13 @@ export default function SizeObserver({
|
|||
|
||||
React.useEffect(() => {
|
||||
const observer = new window.ResizeObserver(entries => {
|
||||
for (let entry of entries) {
|
||||
const rect = entry.contentRect
|
||||
console.log('Element:', entry.target)
|
||||
console.log(`Element size: ${rect.width}px x ${rect.height}px`)
|
||||
console.log(`Element padding: ${rect.top}px ; ${rect.left}px`)
|
||||
setSize({
|
||||
width: rect.width,
|
||||
height: rect.height,
|
||||
})
|
||||
}
|
||||
const entry = entries[0]
|
||||
if (!entry) return
|
||||
const rect = entry.contentRect
|
||||
setSize({
|
||||
width: rect.width,
|
||||
height: rect.height,
|
||||
})
|
||||
})
|
||||
|
||||
if (ref.current) observer.observe(ref.current)
|
||||
|
|
|
|||
Loading…
Reference in a new issue