-
Notifications
You must be signed in to change notification settings - Fork 157
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
the masonry view is blank when i add data to state.data #103
Comments
same problem here, since I tried to load next page when grid end reached |
I get this error on a dynamic data what I did to fix this is to rerender by using state.. add a boolean state that changes when you add a new data to the masonry view example if(this.state.itemsLoaded) {
return (
<View style={{
flex: 1,
padding: 10,
paddingBottom: 80,
backgroundColor: '#f5f6fa',
}}>
<Masonry
bricks={this.state.items}
sorted
spacing={6}
columns={2}
customImageComponent={CustomImage}
imageContainerStyle={{
paddingTop: 10,
backgroundColor: '#ffffff',
borderTopLeftRadius: 10,
borderTopRightRadius: 10,
}}
/>
</View>
);
}
else {
return (
<View>
<Text>Loading Data..</Text>
</View>
);
} you get what I mean? |
@logicallyDimp it's not working for me
|
have you tried doing it like this? if(this.state.loading) {
return (
<View style={styles.ClusterListBoxEmpty}>
<ActivityIndicator animating={true} color="#242424" size="large" />
<Text style={styles.textTitleEmpty}>
Aquí aparecerán las fotos y videos que tomes con Picnow
</Text>
</View>
);
}
else {
if (Object.keys(this.state.ClusterAll).length === 0) {
return (
<View style={styles.ClusterListBoxEmpty}>
<Text style={styles.textTitleEmpty}>No has tomado ninguna foto.</Text>
</View>
);
} else if (Object.keys(this.state.ClusterAll).length > 0) {
let uri = [];
this.state.ClusterAll.map(({ view }) => {
uri.push({ uri: view });
});
console.log(uri);
return (
<View style={styles.ClusterListBox}>
<Masonry
sorted
columns={3} // optional - Default: 2
bricks={uri}
/>
</View>
);
}
} |
@logicallyDimp the first time it renders it does show up as masonry, but the second time it renders it does not as masonry |
same thing for me, have you solved it? |
I don't using it |
So I looked into this issue a while back, it really stems from an async call to load the image, but doesn't complete before the masonry view changes. This causes the masonry to run into a runtime exception and stops loading completely. If anyone wants to try to fix this to integrate cancellable async calls, this should fix the issue (almost certain). |
I still encounter the same issue when appending new data to the list, anyone has a quick fix to it ? |
i use Example at lib, when i click push new data, view is removed
anyone help me, please!
i use version 0.5.0
The text was updated successfully, but these errors were encountered: