-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Description
Currently I'm trying to render a scrollview based on data it will fetch from the server. However I'm encountering some problems.
It seems that when knowing the number of surfaces on render beforehand everything will render fine. This will work:
render() {
let famousSurfaces = range(3).map((event, idx) => {
let options = {//};
return (
<Surface options={options}>
Surface {idx + 1}
</Surface>
);
});
return (
<Context>
<View>
{famousSurfaces}
</View>
</Context>
)
}
However, I would like to render my surfaces dynamically based on my props. This props can change because the data doesn't appear all at once. A simple example is this:
render() {
let famousSurfaces = this.props.events.map((event, idx) => {
let options = {//};
return (
<Surface options={options}>
Surface {idx + 1}
</Surface>
);
});
///etc
I've tried some alternative ways to work around it, but with no luck. The above sample is the most simple example, and working with normaal divs this would work.