Skip to content

Commit 79aedf3

Browse files
authored
[code-infra] Migrate versions page to getStaticProps (#47151)
1 parent 8dc6514 commit 79aedf3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/pages/versions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function getBranches() {
3535
return JSON.parse(text);
3636
}
3737

38-
Page.getInitialProps = async () => {
38+
export async function getStaticProps() {
3939
const FILTERED_BRANCHES = ['latest', 'l10n', 'next', 'migration', 'material-ui.com'];
4040

4141
const branches = await getBranches();
@@ -75,5 +75,5 @@ Page.getInitialProps = async () => {
7575
});
7676
}
7777

78-
return { versions: uniqBy(versions, (item) => item.version) };
79-
};
78+
return { props: { versions: uniqBy(versions, (item) => item.version) } };
79+
}

0 commit comments

Comments
 (0)