diff --git a/src/app/hooks/useLocation.js b/src/app/hooks/useLocation.js index 8de0abb..0101e23 100644 --- a/src/app/hooks/useLocation.js +++ b/src/app/hooks/useLocation.js @@ -1,8 +1,10 @@ import { useEffect, useState } from "react"; import * as Location from "expo-location"; -export default useLocation = () => { - const [location, setLocation] = useState({ longitude: 0.0, latitude: 0.0 }); +export default function useLocation( + defaultLocation = { longitude: 0.0, latitude: 0.0 } +) { + const [location, setLocation] = useState(defaultLocation); const getLocation = async () => { try { @@ -22,4 +24,4 @@ export default useLocation = () => { }, []); return location; -}; +}