Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar committed Dec 18, 2023
1 parent aea3af9 commit 78402fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/repoHook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import github from "../utils/axios";

function RepoCli(user_name) {
function RepoCli({ user_name }) {
const [data, setData] = useState([]);

useEffect(() => {
Expand All @@ -15,8 +15,9 @@ function RepoCli(user_name) {
}
};

// Call fetchData only once by passing an empty dependency array
fetchData();
}, []);
}, [user_name.data]); // Add user_name.data to the dependency array

return (
<>
Expand Down

0 comments on commit 78402fc

Please sign in to comment.