Skip to content

Commit

Permalink
changed the initial state of loading to be true in the useAxios hook
Browse files Browse the repository at this point in the history
  • Loading branch information
0xOmarAdel committed Feb 21, 2024
1 parent 96bcc31 commit 565df94
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ var useAxios = ({
searchParams
}) => {
const [data, setData] = (0, import_react4.useState)(null);
const [loading, setLoading] = (0, import_react4.useState)(false);
const [loading, setLoading] = (0, import_react4.useState)(true);
const [error, setError] = (0, import_react4.useState)(false);
const memoizedSearchParams = (0, import_react4.useMemo)(() => {
return import_query_string.default.parse(searchParams || "");
Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var useAxios = ({
searchParams
}) => {
const [data, setData] = useState2(null);
const [loading, setLoading] = useState2(false);
const [loading, setLoading] = useState2(true);
const [error, setError] = useState2(false);
const memoizedSearchParams = useMemo(() => {
return queryString.parse(searchParams || "");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hookverse",
"version": "1.3.4",
"version": "1.3.5",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
1 change: 1 addition & 0 deletions src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as useFetch } from "./useFetch";
export { default as useClickOutside } from "./useClickOutside";
export { default as useEffectExceptFirstRender } from "./useEffectExceptFirstRender";
export { default as useAxios } from "./useAxios";
2 changes: 1 addition & 1 deletion src/hooks/useAxios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const useAxios = ({
searchParams,
}: UseAxiosProps) => {
const [data, setData] = useState<any | null>(null);
const [loading, setLoading] = useState(false);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(false);

const memoizedSearchParams = useMemo(() => {
Expand Down

0 comments on commit 565df94

Please sign in to comment.