Skip to content
This repository was archived by the owner on Jun 24, 2023. It is now read-only.
This repository was archived by the owner on Jun 24, 2023. It is now read-only.

Edit mode only suspends app useFrame/useUpdate calls #25

@krispya

Description

@krispya

Edit mode is meant to have the app without any loops executing so that objects can be interacted with. The current implementation of this replaces useFrame and useUpdate with an editor version that lets us suspend the callback, but only for calls that originate in the user app -- not from libraries. Consequently, any library interaction or even pointer events from R3F still occur in edit mode.

This can be seen in the ClickAndHover R3F example.

Proposed solution

Instead, I think we should suspend the R3F loop by setting it to never and then running our own loop for rendering while in edit mode. When we exit edit mode, we suspend our loop and let the app execute as it normally would. The API for doing this would be the same between v8 and v9 but v9 would allow more options, for example suspending only certain stages for the purpose of debug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions