Line 9:6: React Hook React.useEffect has a missing dependency: 'init'. Either include it or remove the dependency array
const fetchBusinesses = useCallback(() => {
...
}, [])
useEffect(() => {
fetchBusinesses()
}, [fetchBusinesses])
Line 9:6: React Hook React.useEffect has a missing dependency: 'init'. Either include it or remove the dependency array
const fetchBusinesses = useCallback(() => {
...
}, [])
useEffect(() => {
fetchBusinesses()
}, [fetchBusinesses])
React Hook useEffect has a missing dependency:'. Either include it or remove the dependency array.
import React, { useEffect, useState } from 'react';
import Todo from './Todo';
const TodoList = () => {
const [todos, setTodos] = useState([]);
useEffect(() => {
fetch('https://jsonplaceholder.typicode.com/todos')
.then(response => response.json())
.then(data => {
setTodos(data);
})
});
return (
<div>
{
todos.map(todo => (
<Todo
key={todo.id}
title={todo.title}
completed={todo.completed}
/>
))
}
</div>
)
}
export default TodoList;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us