Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Render only on prop change #536

Open
Specy opened this issue Sep 1, 2024 · 0 comments
Open

Feature Request: Render only on prop change #536

Specy opened this issue Sep 1, 2024 · 0 comments
Labels
enhancement New feature or request v8 Issues related to Pixi React v8

Comments

@Specy
Copy link

Specy commented Sep 1, 2024

Description

It would be nice to add an option to disable the default ticker and render the application only whenever props change.

This can either be a deep prop change (so whenever any of the subtree elements of the stage have a prop change) or only at the stage level, this assumes that no children are using context or side effects outside of the react state (context would work too, but we have to assume that the stage is not memoised, in this way even if the children use a context, whenever the value of the context is updated, the stage would re render too).

To recap:

  1. (harder, perhaps even degrades performance), detect prop changes in the subtree of the stage so that a render is triggered only when needed
  2. Render only when the Stage is rerendered (caused by a react rerender), but add assumption of not using any context in the sub tree, whose value changing doesn't trigger a re render of the stage, and no side effects outside of the react state happen
@trezy trezy added enhancement New feature or request v8 Issues related to Pixi React v8 labels Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v8 Issues related to Pixi React v8
Projects
None yet
Development

No branches or pull requests

2 participants