File tree Expand file tree Collapse file tree 1 file changed +25
-10
lines changed
Expand file tree Collapse file tree 1 file changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -33,23 +33,37 @@ class App extends React.Component {
3333 }
3434 ) ;
3535
36- //this.getFileResults(newPosts);
37- this . apiGetAll ( "../README.md" ) ;
36+ newPosts . map (
37+ ( post ) =>
38+ {
39+ let a = 10 ;
40+ console . log ( "new values===>" + post . data ) ;
41+ let av = this . apiGetAll ( post . data ) ;
42+ console . log ( "json--->" + JSON . stringify ( av ) ) ;
43+ }
44+ ) ;
45+ //this.apiGetAll(newPosts["data"]);
46+ return false ;
3847 }
3948
4049 async apiGetAll ( newPosts ) {
41- console . log ( newPosts )
50+ let cc = [ ] ;
4251 try {
4352 const resp = await fetch ( newPosts ) . then ( res => res . text ( ) ) ;
44-
45- const newResp = await Promise . all ( ( resp ) ) . then ( result => {
53+ console . log ( "fetch---" + resp ) ;
54+ cc . push ( {
55+ data : resp
56+ } ) ;
57+ console . log ( "json--->" + JSON . stringify ( cc ) ) ;
58+ /* const newResp = await Promise.all((resp)).then(result => {
4659 console.log("hey--->"+result);
4760 this.setState({posts1: result});
48- } ) ;
49- console . log ( "dsffdsf====" + this . state . posts1 ) ;
50- return newResp
61+ });*/
62+ // this.setState({posts1: resp});
63+ // console.log("dsffdsf===="+this.state.posts1);
64+ return resp ;
5165 } catch ( err ) {
52- console . log ( err )
66+ console . log ( err ) ;
5367 }
5468 }
5569
@@ -92,9 +106,10 @@ class App extends React.Component {
92106 < div className = "content" >
93107 {
94108 //newPosts.map((post, idx) => (
95- this . state . posts1
109+ // this.state.posts1
96110 // ))
97111 }
112+ < ReactMarkdown source = { this . state . posts1 } />
98113 </ div >
99114 </ div >
100115 </ div >
You can’t perform that action at this time.
0 commit comments