Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { useState, useEffect } from 'react';
- import axios from 'axios';
- const Tasks = () => {
- const [tasks, setTasks] = useState([]);
- useEffect(() => {
- axios.get('/tasks').then(response => setTasks(response.data));
- return (
- <ul>
- {renderList(tasks)}
- </ul>
- );
- },[]);
- };
- renderList(tasks) {
- console.log(tasks)
- return <li>dd</li>
- }
- export default Tasks;
- ./src/compononents/Tasks.js
- Line 16: Parsing error: Unexpected token, expected ";"
- 14 | };
- 15 |
- > 16 | renderList(tasks) {
- | ^
- 17 | console.log(tasks)
- 18 | return <li>dd</li>
- 19 | }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement