-
Notifications
You must be signed in to change notification settings - Fork 481
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
Alternative value subscription implementation #310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks very promising, like the idea of implementing the value registration in a separate class again - since it removes this from the container which becomes much cleaner.
I only have a question about unsubscribing before adding values when setting properties - wouldn't we need to unsubscribe first? (see comment in code).
package/src/renderer/Host.ts
Outdated
} | ||
|
||
abstract draw(ctx: DrawingContext): void | DeclarationResult; | ||
|
||
set props(props: AnimatedProps<P>) { | ||
this.depMgr.addValues(props); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we need to unsubscribe first before subscribing? If we get property updates?
@chrfalch Thanks for the review, I implemented the comments, it is now identical to the previous implementation but much simpler. |
Now the SkiaDrawView on iOS will listen to the RCTBridgeWillInvalidateModulesNotification event on the notification center to tear down and unregister views on hot reload instead of after views are removed.
…ich can cause a crash
…l children in the removeNode method. The removeNode method is only called from the reconciler on the topmost node that is removed, and the documentation says that if we want to release any resources used by children of the removed node we need to do so ourselves - so this has been added.
This is an alternative implementation of #264
fixes #230
fixes #261