vendredi 11 août 2017

React map function doesn't run

i'm trying to show some posts from firebase, but the map() function is not running and the array is not null.

render() {

    console.log('posts', this.state.posts);

    const posts = this.state.posts.map((value, index) => (

        console.log('author', value.author)
        //<Post author="{value.author}" />

    ));

    return (

        <div className="container">
           <div className="col-md-4 col-md-offset-4 mt-md">
                {posts}
           </div>
        </div>
    );
}

Here is the full code -> http://ift.tt/2uNMJOk .

Thanks!




Aucun commentaire:

Enregistrer un commentaire