React infinity state on console.log() using hooks why is that?

import React, {useState} from "react";
const App = ()=>{

    let [state, setState] = useState([])

    .then(result => result.json())
    .then(data => setState(data))


        <h1>Hey there</h1>

export default App;

Read more here:

Content Attribution

This content was originally published by gamerC at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: