File tree Expand file tree Collapse file tree 1 file changed +20
-17
lines changed Expand file tree Collapse file tree 1 file changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -2,24 +2,27 @@ import React from 'react';
22import { Query } from 'react-apollo' ;
33import gql from 'graphql-tag' ;
44
5- const Comments = comments => (
6- < ul >
7- { comments &&
8- comments . comments &&
9- comments . comments . map ( ( { user, text } ) => (
10- < li key = { text } >
11- { user } : { text }
12- </ li >
13- ) ) }
14- </ ul >
15- ) ;
5+ const Comments = ( { comments } ) => {
6+ return (
7+ < ul >
8+ { comments &&
9+ comments . map ( ( { user, text } ) => (
10+ < li key = { text } >
11+ { user } : { text }
12+ </ li >
13+ ) ) }
14+ </ ul >
15+ ) ;
16+ } ;
1617
17- const Book = ( { title, author, comments } ) => (
18- < div >
19- < p > { `${ title } by ${ author } ` } </ p >
20- < Comments comments = { comments } />
21- </ div >
22- ) ;
18+ const Book = ( { title, author, comments } ) => {
19+ return (
20+ < div >
21+ < p > { `${ title } by ${ author } ` } </ p >
22+ < Comments comments = { comments } />
23+ </ div >
24+ ) ;
25+ } ;
2326
2427const Books = ( ) => (
2528 < Query
You can’t perform that action at this time.
0 commit comments