question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simplified example renders nothing

See original GitHub issue

I have a suspicion you are assuming existence of the header/footer as your example builds/runs but when I try my simplified code I get nothing rendered.


const onPress = e => console.log(e);
const img1 = 'https://img.buzzfeed.com/buzzfeed-static/static/2014-12/1/15/enhanced/webdr02/enhanced-18393-1417466529-5.jpg';
const img2 = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSXXTmdaGSOFK8iBeYqoA6_XiQGGWvu6KGnqAxXYyvJA-JKin8ImQ';
const img3 = 'https://img.buzzfeed.com/buzzfeed-static/static/2015-04/3/15/enhanced/webdr06/enhanced-24427-1428089292-2.jpg';

// And tried with flex: 1, I know container is coming up on UI, but no images. 
...render

      <View style={{height: '100%'}}>
        <Masonry
          columns={3}
          bricks={[
            { uri: img1, id: 1, onPress },
            { uri: img2, id: 2, onPress },
            { uri: img3 , id: 3, onPress}
          ]}
          />
      </View>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
brh55commented, Jun 21, 2017

Odd it will display if you wrap the masonry with a scrollview. I’m assuming it has to do with the listview.rowHasChanged method.

Image preview was too big lol, so here is a link: image

import React, { Component } from 'react';
import {
	ScrollView
} from 'react-native';
import Masonry from 'react-native-masonry';

const onPress = e => console.log(e);
const img1 = 'https://img.buzzfeed.com/buzzfeed-static/static/2014-12/1/15/enhanced/webdr02/enhanced-18393-1417466529-5.jpg';
const img2 = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSXXTmdaGSOFK8iBeYqoA6_XiQGGWvu6KGnqAxXYyvJA-JKin8ImQ';
const img3 = 'https://img.buzzfeed.com/buzzfeed-static/static/2015-04/3/15/enhanced/webdr06/enhanced-24427-1428089292-2.jpg';


export default class example extends Component {
  constructor() {
    super();
  }

  render() {
    return (
      <ScrollView style={{backgroundColor: '#f4f4f4'}}>
        <Masonry
          columns={3}
          bricks={[
            { uri: img1, id: 1, onPress },
            { uri: img2, id: 2, onPress },
            { uri: img3 , id: 3, onPress}
          ]}
          />
      </ScrollView>
    );
  }
}
1reaction
fxfactorialcommented, Jun 21, 2017

No, none, would have mentioned it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React component not rendering in simple example
Reason: If a React Component name starts with a lowercase letter , nothing Renders , and you don't get any error message ...
Read more >
REACT – Simple Intro Component Not Rendering?
For example, say you have the following component, mainIntro.js : const mainIntro = props => ( <div id="quote-box"> <h1> Hunter x Hunter ...
Read more >
The simplest way to get a good render (Blender Tutorial)
Here is my simple 4-step approach to rendering anything in Blender.▻▻ Enroll in our FREE SciFi Terminal Design ...
Read more >
ReactJS: "Nothing was returned from render" - What the Error?
How to solve the " Nothing was returned from render " error in ReactJS.You can find a text version of this post on...
Read more >
Need a simple 3d rendering example · Issue #79 - GitHub
Need a simple 3d rendering example, like a cube or sphere, nothing fancy. Deferred or Forward defined in yaml file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found