Closed JerinBaby closed 6 years ago
Is it possible?
@emurigar @JerinBaby This is possible as I have used this the other day. There is a "isActive" prop that is used. below is the code I used. it needs to be the 3rd one in the function
_renderHeader(section, id, isActive) {
return (
<View style={listView.main}>
{isActive ? (
<View style={listView.innerActive}>
<Text style={listView.text}>{section.region}</Text>
<IconDown fontSize={10} color={colors.darkGreen} />
</View>
) : (
<View style={listView.inner}>
<Text style={listView.text}>{section.region}</Text>
<IconRight fontSize={16} color={colors.darkGreen} />
</View>
)}
</View>
);
}
You need to pass the prop into the renderHeader here is the component
<Accordion
sections={this.state.data}
renderHeader={this._renderHeader}
renderContent={this._renderContent}
touchableComponent={TouchableOpacity}
/>
I'm just switching the icon on the active prop. Let me know if you need a hand 👍
@ThomasLarge thanks very much for your help!! I made it! Thanks again
@emurigar not a problem :)
How to integrate collapsible buttons to collapsible header?