-
Notifications
You must be signed in to change notification settings - Fork 734
Feat/expandable list item new component #943
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
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.
Few comments on this PR
First, try avoid having an inline style. Always move styles into StyleSheet when possible.
Passing inline style can affect performance.
Second, Regarding the structure of the component. I left some comments.
Let me know if something is not clear..
One last thing.
Notice that when you collapse the component, there's a brief moment where you can still see the children overflow the boundary. Try looking into the overflow
style prop in order to fix that..
…b.com/wix/react-native-ui-lib into feat/expandableListItem_new_component
const {expanded, sectionHeader, children} = props; | ||
|
||
function onValueChange() { | ||
LayoutAnimation.configureNext({...LayoutAnimation.Presets.easeInEaseOut, duration: 200}); |
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.
We don't trigger animation or update things during a render.
Render can be triggered for many reasons and that means you'll trigger an animation even when you don't intend to.
For that we use hooks like useEffect
. (or lifecycle methods in case you use classes)
*/ | ||
children?: React.ReactNode; | ||
/** | ||
* expandableSection icon color |
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.
You forgot changing the prop description (:
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.
🙊
Description
Add generic expandableSection component that render headerSection element and children as a content of the component.