How do custom hooks in react work? Do not understand what initialValue stands for

useLocalStorage.js

import {useEffect,useState} from 'react'

const PREFIX='whatsapp-clone-'

function useLocalStorage(key,initialValue) {

    const prefixedKey=PREFIX+key

    const[value,setValue]=useState(()=>{

        const jsonValue=localStorage.getItem(prefixedKey)

        if(jsonValue==!null) return JSON.parse(jsonValue)

        if(typeof initialValue==='function'){

            return initialValue()

        }else{

return initialValue

        }

    })

useEffect(()=>{

    localStorage.setItem(prefixedKey,JSON.stringify(value))

},[prefixedKey,value])

return [value,setValue]

}

export default useLocalStorage

App.js

import React from 'react'

import Login from './Login'

import useLocalStorage from '../hooks/useLocalStorage'

function App() {

 const[id,setId]=useLocalStorage('id')

  return (

    <>

    {id?<Dashboard id={id}/>:<Login onIdSubmit={setId}/>}

    

    </>

  );

}

export default App;