happiness (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) happiness

【antd】AffixでFind more than one child node with `children` in ResizeObserver. の対処法

エラー内容

Warning: Find more than one child node with `children` in ResizeObserver. Will only observe first one. 
    at ResizeObserver (http://tsubasa3-admin.lo.ckpd.co:3000/packs/js/admin/app-f9c80ce1c70b5a13586e.js:128315:96)
    at div
    at div

原因

Affix内の要素は一つだけにする必要がある

変更前

<Affix offsetTop={10}>
  <h1>hello</h1> # 1個目
  <p>world</p> # 2個目
</Affix>

変更後

<Affix offsetTop={10}>
  <div>
    <h1>hello</h1> # 1個目
    <p>world</p> # 2個目
  </div>
</Affix>

success!