Skip to content
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

Invariant Violation: Tried to get frame for out of range index 0 #5

Open
iamir4g opened this issue Apr 19, 2021 · 0 comments
Open

Invariant Violation: Tried to get frame for out of range index 0 #5

iamir4g opened this issue Apr 19, 2021 · 0 comments

Comments

@iamir4g
Copy link

iamir4g commented Apr 19, 2021

hi, thanks for this good package :
this is my array :
 (6) [{…}, {…}, {…}, {…}, {…}, {…}]
and this is object of array :

data: {_id: "60631b49aa0bbe63062f97e7", name: "سوخاری ها", slug: "frize", preparation_duration: 25, show_calory: false, …}
title: "سوخاری ها"

and this is my SectionList :

{this.state.categories.length > 0 ? <SectionList
                            renderItem={({ item, index, section }) => {
                                                                return (
                                    <Text key={index}>{item.title}</Text>
                                )
                            }}
                            renderSectionHeader={({ section: { title } }) => (
                                <Text style={{ fontWeight: 'bold' }}>{title}</Text>
                            )}
                            renderTab={({ title, isActive }) => {  
                                return (
                                    <View
                                     style={[
                                        styles.tabContainer,
                                         { borderBottomWidth: isActive ? 1 : 0 }
                                     ]}
                                    >
                                        <Text
                                        style={[
                                          styles.tabText,
                                          { color: isActive ? '#090909' : '#9e9e9e' }
                                        ]}
                                        >
                                            {title}
                                        </Text>
                                    </View>
                                )
                            }
                            }
                            sections={this.state.categories}
                            keyExtractor={(item, index) => { console.log(item); index.toString() }}
                        /> :
                            <View><Text>Nothing</Text></View>}

but get this error :

Invariant Violation: Tried to get frame for out of range index 0

how to solve this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant