Whenever I visit a page it should automatically fetch the API

```js
import React from 'react'

const Component = () => {
  fetch("api url").then((res) => console.log(res))
  return (
    <div>comp</div>
  )
}

export default Component

```