We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29c148e commit e5d5273Copy full SHA for e5d5273
pages/country/[name].js
@@ -18,10 +18,13 @@ export async function getStaticPaths() {
18
19
export async function getStaticProps(context) {
20
const { name } = context.params;
21
- return { props: { name } };
+ const response = await fetch(DATA);
22
+ const data = await response.json();
23
+ const rows = data[name];
24
+ return { props: { name, rows } };
25
}
26
-export default function Country({ name }) {
27
+export default function Country({ name, rows }) {
28
return (
29
<>
30
<h1 style={{ textAlign: "center" }}>{name}</h1>
0 commit comments