React-native – use separator React Native NativeBase ListView

I currently use React Native’s ListView to display a list with section headers (renderSectionHeader):

 dataSource={this.state.dataSource}
renderRow={(rowData) => }
renderSectionHeader={(sectionData, sectionId) => )
/>

dataSource contains an object Array, which contains the section header in the key, and an array of list items, such a value

{
Section 1: [{firstName:'A', lastName:'B'}, {firstName:'C', lastName:'D'}],
Section 2: [{firstName:'E', lastName:'F'}, {firstName:'G', lastName:'H'}]
}

I want to know if I can use NativeBase The List component implements the same (and has a better-looking layout). However, I can’t find any information on how to pass in the section title:



{data}

} />

< p>Is this possible, and if so, are there any disadvantages of using it instead of React Native’s ListView?

In theory, NativeBase’s List should accept the props supported by React Native’s ListView.

< /p>

You can use the itemHeader prop to render the section heading:


ACTION

I currently use React Native’s ListView to display a list with section headers (renderSectionHeader):

 dataSource={this.state.dataSource}
renderRow={(rowData) => }
renderSectionHeader={(sectionData, sectionId) => )
/>

dataSource contains an object Array, which contains the section header in the key, and an array of list items, such a value< /p>

{
Section 1: [{firstName:'A', lastName:'B'}, {firstName:'C', lastName:'D'}] ,
Section 2: [{firstName:'E', lastName:'F'}, {firstName:'G', lastName:'H'}]
}

I Want to know if the same can be achieved using NativeBase’s List component (and has a better-looking layout). However, I can’t find any information on how to pass in the section title:

 

{data}

} />

Is this possible, and if so, is there a ListView that uses it instead of React Native Shortcomings?

In theory, NativeBase’s List should accept the props supported by React Native’s ListView.

You can use itemHeader prop to render the section Title:


ACTION

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5917 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.