Closed Socvest closed 6 months ago
I had come here to suggest the exact same change to the python code: remove component call from init and try-except on delete. Happy to see it already here. @Mohamed-512 could you please review this PR.
Hey all, thanks for the PR, however the change is not usable. I tested it and if a cookie is added, it will not reflect with the following rerender, and I have to refresh the page to be able to see it. Also getting an added cookie, is not possible as None
is always returned. Let me know if I have missed a setup in my testing
Fixed it in a different way. Try version 0.1.70 of the package.
I love the cookies part of this package but thought the performance was far too poor to be deployed for production. I then adopted the methodology for my package that saves data to local storage (view here). Only renders when there is a change to the
method
variable which I implemented in the src file.This video shows the drastic reduction in the number of re-renders which improves component performance.
I also found that the double rendering was derived from calling the
get_all()
method when the class is initialised. This causes far too many rendering and removing this caused component to render once (only when called - when the app re-reruns but once not multiple time).