Skip to content

getpooled function is unexpected #152

@liuhanqu

Description

@liuhanqu
const Child = () => {
  const [ setRef ] = useIntersectionObserver(() => {}, { root: document.body });

  return <div ref={setRef}></div>
}

function App() {
  return (
    <div className="App">
      <Child />
      <Child />
    </div>
  );
}

Expected behavior

the observer instance create in first child would be reuse in second child

Current behavior

two child create two observer instance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions