0

const [beautyInfo,setBeautyInfo]= useState([])
useEffect(() => {
  fetch("http://localhost:8085/b2/beauty-info-test/beauty-info/44810")
  .then(response => {
    if(!response.ok){
      throw new Error("Network response was not OK")
    }
    return response.json()})
  .then(data => console.log(data))
  .catch(err => console.log(err))
},[])


Im still a new engineer, so I'm kinda lost on why its showing twice. what happens exactly is I run the backend, I run the frontend, I go to chrome, and right click inspect then it pops up twice instead of once. Thanks for help!

  • 1
    Probably the shenanigans of `React.StrictMode` - see [fb/react#24502](https://github.com/facebook/react/issues/24502) – kelsny Nov 15 '22 at 19:42
  • Does this answer your question? [React Hooks render twice](https://stackoverflow.com/questions/58603209/react-hooks-render-twice) – Samathingamajig Nov 15 '22 at 19:49

0 Answers0