Warning: Find more than one child node with `children` in ResizeObserver. Will only observe first one

3k Views Asked by At

Like the description of title.In my react application has the Warning.

System: Mac OS Big Sur 11.2

Enviroment: Chrome 89.0.4389.90(正式版本) (x86_64)

The warning detail

1

There are 1 best solutions below

0
On BEST ANSWER

I suspect this is the same problem I had with Ant Design <Affix /> Component.

Basically, your Affix Component (probably) has multiple children as below:

<Affix>
    <div>...1</div>
    <div>...2</div>
</Affix>

It should only have one child - a little like React JSX should only have one root component returned.

So the above can become:

<Affix>
    <div>
        <div>...1</div>
        <div>...2</div>
    </div>
</Affix>