Browse Source

added comments

Luis Ortiz 1 year ago
parent
commit
920a07ba7f
1 changed files with 7 additions and 4 deletions
  1. 7
    4
      Noticias.js

+ 7
- 4
Noticias.js View File

4
 //data display
4
 //data display
5
 export default function Noticias() {
5
 export default function Noticias() {
6
     const [users,setUsers] = useState([]);
6
     const [users,setUsers] = useState([]);
7
-  
7
+
8
     useEffect(()=>{
8
     useEffect(()=>{
9
       fetchData()
9
       fetchData()
10
     },[]);
10
     },[]);
11
-      
11
+
12
+    //Busca la informacion en la base de datos
12
     const fetchData = () => {
13
     const fetchData = () => {
13
       //fetch('https://ada.uprrp.edu/~luis.ortiz79/api/users/',{
14
       //fetch('https://ada.uprrp.edu/~luis.ortiz79/api/users/',{
14
       fetch('http://localhost/apicenso/users/')
15
       fetch('http://localhost/apicenso/users/')
20
         })
21
         })
21
         .catch(error => console.log(error))
22
         .catch(error => console.log(error))
22
     }
23
     }
23
-    
24
+
25
+    //Es donde va a desplegar la informacion de la base de datos
24
     const renderUser = ({item}) => {
26
     const renderUser = ({item}) => {
25
       return (
27
       return (
26
         <View style={{margin:10,borderWidth:0.5,padding:10}}>
28
         <View style={{margin:10,borderWidth:0.5,padding:10}}>
32
         </View>
34
         </View>
33
       )
35
       )
34
     }
36
     }
37
+
35
     return (
38
     return (
36
       <View style={{flex:1,backgroundColor:"white"}}>
39
       <View style={{flex:1,backgroundColor:"white"}}>
37
         <FlatList
40
         <FlatList
41
           />
44
           />
42
       </View>
45
       </View>
43
     )
46
     )
44
-}
47
+}