I want to set state as props in react using hooks and I'm getting error:
`Too many re-renders. React limits the number of renders to prevent an infinite loop.
▶ 34 stack frames were collapsed.`

My code:
First Component :

```
const List = () => {
    const [items, setItems] = useState([{}])
    useEffect(() => {
        const fetchData = async () => {
            const data = await fetch(
                'http://localhost:5000/api',
            );
            const result = await data.json();
            setItems(result);
        };
        fetchData();
    }, []);
   return (
          <ActualList items={items}/>
    )
}

```

and the second component:

```
const ActualList = props => {
    const [items, setItems] = useState([{}])
    setItems(props.items)
    }
...

```