Skip to content

Commit f29b87f

Browse files
committed
Added numOfrepos as prop
1 parent c996cd3 commit f29b87f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

example/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "github-repo-display-react/dist/index.css"
66
const App = () => {
77
return (
88
<div className='repos'>
9-
<GithubRepoDisplay userName='msmfa' />
9+
<GithubRepoDisplay numOfrepos={5} userName='msmfa' />
1010
</div>
1111
)
1212
}

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ const fetchApiData = async (username) => {
99
return response.data
1010
}
1111

12-
function GetRepoData({ userName }) {
12+
function GetRepoData({ userName, numOfrepos }) {
1313
const [repoData, setRepoData] = useState([])
1414

1515
useEffect(() => {
1616
fetchApiData(userName).then(setRepoData)
1717
}, [userName])
1818

19-
return <DisplaySortedRepoData numOfrepos={3} repoData={repoData} />
19+
return <DisplaySortedRepoData numOfrepos={numOfrepos} repoData={repoData} />
2020
}
2121

22-
export const GithubRepoDisplay = ({ userName }) => {
22+
export const GithubRepoDisplay = ({ userName, numOfrepos }) => {
2323
return (
2424
<div className={styles.test}>
2525
{" "}
26-
<GetRepoData userName={userName} />
26+
<GetRepoData numOfrepos={numOfrepos} userName={userName} />
2727
</div>
2828
)
2929
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy