react-three-fiber icon indicating copy to clipboard operation
react-three-fiber copied to clipboard

fix: createPortal effect merging stale data from initial render

Open notrabs opened this issue 1 month ago • 2 comments

Fixes #3253

  • Added a missing dependency on the inject function, which caused the effect to update a portal's store with stale data from the initial render
  • The store destruction has been moved to a separate hook, so it continues to run only on component unmount

notrabs avatar May 07 '24 20:05 notrabs

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b4e0e3a88e3dcd5e6384c41b71f35fbfc8d24a17:

Sandbox Source
example Configuration

codesandbox-ci[bot] avatar May 07 '24 20:05 codesandbox-ci[bot]

Testing locally, I now get the expected sequence of events (using the minimal repro): image

notrabs avatar May 07 '24 20:05 notrabs