chore: abandon useLayoutEffect

This commit is contained in:
EnixCoda 2020-03-15 02:28:59 +08:00
parent 712c56cbb8
commit e3ffc8f82b
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -29,7 +29,7 @@ export function SizeObserver({ type = 'div', children, ...rest }: Props) {
)
}, [])
React.useLayoutEffect(() => {
React.useEffect(() => {
if (features.resize) {
const observer = new window.ResizeObserver(entries => {
const entry = entries[0]