-
Notifications
You must be signed in to change notification settings - Fork 62
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
WIP perf: add PureSkeletonContent
component to improve performance by reducing re-rendering of component
#29
base: master
Are you sure you want to change the base?
Conversation
…educing re-rendering of component
…ove all types to types file and export it
…yle` to avoid typescript errors
…functions for bones generation BREAKING CHANGE: the main container no longer justifyContents and alignItems center. The test around bones styles fails as there is a switch in Animated.View used.
@alexZajac @mernxl Is there an update here? Would be very interested in this feature. |
Thanks for the PR! We would need the checks to pass for it to be merged! |
# Conflicts: # package-lock.json # package.json # src/Constants.ts # src/SkeletonContent.tsx # src/__tests__/SkeletonContent.test.tsx # src/__tests__/__snapshots__/SkeletonContent.test.tsx.snap
…g tests BREAKING CHANGE: the main container no longer justifyContents and alignItems center. The test around bones styles fails as there is a switch in Animated.View used.
Hi, this MR will need some more review and probably some talks. If possible @alexZajac could you test on a local project? It's been a while I worked on such a project. I am available to help drive this towards a positive direction. My initial change was we use Animated from react-native and ditch reanimated. But then it's been a while, it's possible there's been some updates that fixes a lot. Let's just take the time to review and see how to get to a good point. |
PureSkeletonContent
component to improve performance by reducing re-rendering of componentPureSkeletonContent
component to improve performance by reducing re-rendering of component
Hi! Yeah, this one slipped over my hands with the amount of work I had on the side, not sure if having a different component is the way to go here. My rationale is that if this one is "more performant" than the other Thoughts? |
Actually replacing without deprecating the current will make the community unstable. It will take time to migrate, most people will move away from the library. I would say I actually use them both within my project, for huge components, I will go with Pure, when I have small things to display within, I go with the current. The primary function of the The current |
This is a proof of concept as well as a final code to support this issue #28 i opened earlier.
As a guide, this section has been added to the README file.
PureSkeletonContent
If you are really concerned about performance, or you don't want your components mounting being runned while
isLoading
is false, then you may need to consider usingPureSkeletonContent
.Point to note
All props passed to PureSkeletonContent should be a constant prop, memoize it if it will change sometime.
Otherwise, you should consider using the good old
SkeletonContent
.