react-expandable-listview icon indicating copy to clipboard operation
react-expandable-listview copied to clipboard

Customise sub components such as header and item

Open stevemao opened this issue 8 years ago • 5 comments

I wanna use a completely different header in my app 😛

stevemao avatar Nov 19 '15 11:11 stevemao

@stevemao what sort of header would you like to include?

cht8687 avatar Nov 21 '15 11:11 cht8687

Any arbitrary component

Sent from my iPhone

On 21 Nov 2015, at 10:01 PM, Robert Chang [email protected] wrote:

@stevemao what sort of header would you like to include?

— Reply to this email directly or view it on GitHub.

stevemao avatar Nov 21 '15 11:11 stevemao

What about this:

import CustomHeader from 'CustomHeader';
import CustomItem from 'CustomItem';

<ReactExpandableListView 
        data={data} 
        header={CustomHeader}
        item={CustomItem} 
        styles={styles}
      />

stevemao avatar Nov 24 '15 04:11 stevemao

this is a good suggestion, however, think about how could you manage the headers and items without loop through each of them? it's difficult to pass in the whole objects as props.

the options already supply you styles option. You can use it to achieve your needs.

cht8687 avatar Dec 11 '15 12:12 cht8687

I think this is achieveable....

cht8687 avatar Oct 19 '16 21:10 cht8687