drei icon indicating copy to clipboard operation
drei copied to clipboard

fix(Stage): wrap the environment with suspense

Open dineshsalunke opened this issue 2 years ago • 5 comments

Why

Environment in the Stage component isn't wrapped in Suspense, so changing the environment prop on it causes the whole stage component flash till the new environment is loaded.

Ideally it would be good if we can keep the previous environment till the new one is loaded, thoughts on this ?

What

Wrapped the Environment component in Suspense and added fallback prop on the stage component

Checklist

  • [ ] Documentation updated
  • [ ] Storybook entry added
  • [ ] Ready to be merged

If the draft is ok then I will update the doc with the fallback prop details if required

dineshsalunke avatar Aug 18 '22 06:08 dineshsalunke

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
drei ❌ Failed (Inspect) Sep 7, 2022 at 4:02AM (UTC)

vercel[bot] avatar Aug 18 '22 06:08 vercel[bot]

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 291092ce7a7518176b65e69a4513a89a8b0f949d:

Sandbox Source
thirsty-sea-12sn3n Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

codesandbox-ci[bot] avatar Aug 18 '22 06:08 codesandbox-ci[bot]

keeping the previous would be possible with useTransition

drcmda avatar Aug 30 '22 11:08 drcmda

what do you mean by prop is a transition ?

On Tue, Sep 6, 2022 at 6:48 PM — @.***> wrote:

@dineshsalunke https://github.com/dineshsalunke keeping the current one would be possible if the prop is a transition.

— Reply to this email directly, view it on GitHub https://github.com/pmndrs/drei/pull/1008#issuecomment-1238140311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS6OEJBFHY777UTPYRZBQ3V45ADHANCNFSM564ALEWQ . You are receiving this because you were mentioned.Message ID: @.***>

dineshsalunke avatar Sep 07 '22 03:09 dineshsalunke

@drcmda we might need to update types for react

dineshsalunke avatar Sep 08 '22 09:09 dineshsalunke