From 7b5e0e9756920976edbacab16684b042b3a3f688 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Mon, 1 Aug 2022 11:44:12 +0200 Subject: [PATCH] [core] Replace `getInitialProps` with `getStaticProps` (#33684) --- docs/pages/base/api/badge-unstyled.js | 10 ++++++---- docs/pages/base/api/button-unstyled.js | 10 ++++++---- docs/pages/base/api/click-away-listener.js | 10 ++++++---- docs/pages/base/api/form-control-unstyled.js | 10 ++++++---- docs/pages/base/api/input-unstyled.js | 10 ++++++---- docs/pages/base/api/menu-item-unstyled.js | 10 ++++++---- docs/pages/base/api/menu-unstyled.js | 10 ++++++---- docs/pages/base/api/modal-unstyled.js | 10 ++++++---- docs/pages/base/api/multi-select-unstyled.js | 10 ++++++---- docs/pages/base/api/no-ssr.js | 10 ++++++---- docs/pages/base/api/option-group-unstyled.js | 10 ++++++---- docs/pages/base/api/option-unstyled.js | 10 ++++++---- docs/pages/base/api/popper-unstyled.js | 10 ++++++---- docs/pages/base/api/portal.js | 10 ++++++---- docs/pages/base/api/select-unstyled.js | 10 ++++++---- docs/pages/base/api/slider-unstyled.js | 10 ++++++---- docs/pages/base/api/switch-unstyled.js | 10 ++++++---- docs/pages/base/api/tab-panel-unstyled.js | 10 ++++++---- docs/pages/base/api/tab-unstyled.js | 10 ++++++---- docs/pages/base/api/table-pagination-unstyled.js | 10 ++++++---- docs/pages/base/api/tabs-list-unstyled.js | 10 ++++++---- docs/pages/base/api/tabs-unstyled.js | 10 ++++++---- docs/pages/base/api/textarea-autosize.js | 10 ++++++---- docs/pages/base/api/trap-focus.js | 10 ++++++---- docs/pages/experiments/index.js | 8 +++++--- docs/pages/material-ui/api/accordion-actions.js | 10 ++++++---- docs/pages/material-ui/api/accordion-details.js | 10 ++++++---- docs/pages/material-ui/api/accordion-summary.js | 10 ++++++---- docs/pages/material-ui/api/accordion.js | 10 ++++++---- docs/pages/material-ui/api/alert-title.js | 10 ++++++---- docs/pages/material-ui/api/alert.js | 10 ++++++---- docs/pages/material-ui/api/app-bar.js | 10 ++++++---- docs/pages/material-ui/api/autocomplete.js | 10 ++++++---- docs/pages/material-ui/api/avatar-group.js | 10 ++++++---- docs/pages/material-ui/api/avatar.js | 10 ++++++---- docs/pages/material-ui/api/backdrop.js | 10 ++++++---- docs/pages/material-ui/api/badge.js | 10 ++++++---- docs/pages/material-ui/api/bottom-navigation-action.js | 10 ++++++---- docs/pages/material-ui/api/bottom-navigation.js | 10 ++++++---- docs/pages/material-ui/api/box.js | 10 ++++++---- docs/pages/material-ui/api/breadcrumbs.js | 10 ++++++---- docs/pages/material-ui/api/button-base.js | 10 ++++++---- docs/pages/material-ui/api/button-group.js | 10 ++++++---- docs/pages/material-ui/api/button.js | 10 ++++++---- docs/pages/material-ui/api/card-action-area.js | 10 ++++++---- docs/pages/material-ui/api/card-actions.js | 10 ++++++---- docs/pages/material-ui/api/card-content.js | 10 ++++++---- docs/pages/material-ui/api/card-header.js | 10 ++++++---- docs/pages/material-ui/api/card-media.js | 10 ++++++---- docs/pages/material-ui/api/card.js | 10 ++++++---- docs/pages/material-ui/api/checkbox.js | 10 ++++++---- docs/pages/material-ui/api/chip.js | 10 ++++++---- docs/pages/material-ui/api/circular-progress.js | 10 ++++++---- docs/pages/material-ui/api/collapse.js | 10 ++++++---- docs/pages/material-ui/api/container.js | 10 ++++++---- docs/pages/material-ui/api/css-baseline.js | 10 ++++++---- docs/pages/material-ui/api/dialog-actions.js | 10 ++++++---- docs/pages/material-ui/api/dialog-content-text.js | 10 ++++++---- docs/pages/material-ui/api/dialog-content.js | 10 ++++++---- docs/pages/material-ui/api/dialog-title.js | 10 ++++++---- docs/pages/material-ui/api/dialog.js | 10 ++++++---- docs/pages/material-ui/api/divider.js | 10 ++++++---- docs/pages/material-ui/api/drawer.js | 10 ++++++---- docs/pages/material-ui/api/fab.js | 10 ++++++---- docs/pages/material-ui/api/fade.js | 10 ++++++---- docs/pages/material-ui/api/filled-input.js | 10 ++++++---- docs/pages/material-ui/api/form-control-label.js | 10 ++++++---- docs/pages/material-ui/api/form-control.js | 10 ++++++---- docs/pages/material-ui/api/form-group.js | 10 ++++++---- docs/pages/material-ui/api/form-helper-text.js | 10 ++++++---- docs/pages/material-ui/api/form-label.js | 10 ++++++---- docs/pages/material-ui/api/global-styles.js | 10 ++++++---- docs/pages/material-ui/api/grid.js | 10 ++++++---- docs/pages/material-ui/api/grow.js | 10 ++++++---- docs/pages/material-ui/api/hidden.js | 10 ++++++---- docs/pages/material-ui/api/icon-button.js | 10 ++++++---- docs/pages/material-ui/api/icon.js | 10 ++++++---- docs/pages/material-ui/api/image-list-item-bar.js | 10 ++++++---- docs/pages/material-ui/api/image-list-item.js | 10 ++++++---- docs/pages/material-ui/api/image-list.js | 10 ++++++---- docs/pages/material-ui/api/input-adornment.js | 10 ++++++---- docs/pages/material-ui/api/input-base.js | 10 ++++++---- docs/pages/material-ui/api/input-label.js | 10 ++++++---- docs/pages/material-ui/api/input.js | 10 ++++++---- docs/pages/material-ui/api/linear-progress.js | 10 ++++++---- docs/pages/material-ui/api/link.js | 10 ++++++---- docs/pages/material-ui/api/list-item-avatar.js | 10 ++++++---- docs/pages/material-ui/api/list-item-button.js | 10 ++++++---- docs/pages/material-ui/api/list-item-icon.js | 10 ++++++---- .../material-ui/api/list-item-secondary-action.js | 10 ++++++---- docs/pages/material-ui/api/list-item-text.js | 10 ++++++---- docs/pages/material-ui/api/list-item.js | 10 ++++++---- docs/pages/material-ui/api/list-subheader.js | 10 ++++++---- docs/pages/material-ui/api/list.js | 10 ++++++---- docs/pages/material-ui/api/loading-button.js | 10 ++++++---- docs/pages/material-ui/api/masonry.js | 10 ++++++---- docs/pages/material-ui/api/menu-item.js | 10 ++++++---- docs/pages/material-ui/api/menu-list.js | 10 ++++++---- docs/pages/material-ui/api/menu.js | 10 ++++++---- docs/pages/material-ui/api/mobile-stepper.js | 10 ++++++---- docs/pages/material-ui/api/modal.js | 10 ++++++---- docs/pages/material-ui/api/native-select.js | 10 ++++++---- docs/pages/material-ui/api/outlined-input.js | 10 ++++++---- docs/pages/material-ui/api/pagination-item.js | 10 ++++++---- docs/pages/material-ui/api/pagination.js | 10 ++++++---- docs/pages/material-ui/api/paper.js | 10 ++++++---- docs/pages/material-ui/api/popover.js | 10 ++++++---- docs/pages/material-ui/api/popper.js | 10 ++++++---- docs/pages/material-ui/api/radio-group.js | 10 ++++++---- docs/pages/material-ui/api/radio.js | 10 ++++++---- docs/pages/material-ui/api/rating.js | 10 ++++++---- docs/pages/material-ui/api/scoped-css-baseline.js | 10 ++++++---- docs/pages/material-ui/api/select.js | 10 ++++++---- docs/pages/material-ui/api/skeleton.js | 10 ++++++---- docs/pages/material-ui/api/slide.js | 10 ++++++---- docs/pages/material-ui/api/slider.js | 10 ++++++---- docs/pages/material-ui/api/snackbar-content.js | 10 ++++++---- docs/pages/material-ui/api/snackbar.js | 10 ++++++---- docs/pages/material-ui/api/speed-dial-action.js | 10 ++++++---- docs/pages/material-ui/api/speed-dial-icon.js | 10 ++++++---- docs/pages/material-ui/api/speed-dial.js | 10 ++++++---- docs/pages/material-ui/api/stack.js | 10 ++++++---- docs/pages/material-ui/api/step-button.js | 10 ++++++---- docs/pages/material-ui/api/step-connector.js | 10 ++++++---- docs/pages/material-ui/api/step-content.js | 10 ++++++---- docs/pages/material-ui/api/step-icon.js | 10 ++++++---- docs/pages/material-ui/api/step-label.js | 10 ++++++---- docs/pages/material-ui/api/step.js | 10 ++++++---- docs/pages/material-ui/api/stepper.js | 10 ++++++---- docs/pages/material-ui/api/svg-icon.js | 10 ++++++---- docs/pages/material-ui/api/swipeable-drawer.js | 10 ++++++---- docs/pages/material-ui/api/switch.js | 10 ++++++---- docs/pages/material-ui/api/tab-context.js | 10 ++++++---- docs/pages/material-ui/api/tab-list.js | 10 ++++++---- docs/pages/material-ui/api/tab-panel.js | 10 ++++++---- docs/pages/material-ui/api/tab-scroll-button.js | 10 ++++++---- docs/pages/material-ui/api/tab.js | 10 ++++++---- docs/pages/material-ui/api/table-body.js | 10 ++++++---- docs/pages/material-ui/api/table-cell.js | 10 ++++++---- docs/pages/material-ui/api/table-container.js | 10 ++++++---- docs/pages/material-ui/api/table-footer.js | 10 ++++++---- docs/pages/material-ui/api/table-head.js | 10 ++++++---- docs/pages/material-ui/api/table-pagination.js | 10 ++++++---- docs/pages/material-ui/api/table-row.js | 10 ++++++---- docs/pages/material-ui/api/table-sort-label.js | 10 ++++++---- docs/pages/material-ui/api/table.js | 10 ++++++---- docs/pages/material-ui/api/tabs.js | 10 ++++++---- docs/pages/material-ui/api/text-field.js | 10 ++++++---- docs/pages/material-ui/api/timeline-connector.js | 10 ++++++---- docs/pages/material-ui/api/timeline-content.js | 10 ++++++---- docs/pages/material-ui/api/timeline-dot.js | 10 ++++++---- docs/pages/material-ui/api/timeline-item.js | 10 ++++++---- .../pages/material-ui/api/timeline-opposite-content.js | 10 ++++++---- docs/pages/material-ui/api/timeline-separator.js | 10 ++++++---- docs/pages/material-ui/api/timeline.js | 10 ++++++---- docs/pages/material-ui/api/toggle-button-group.js | 10 ++++++---- docs/pages/material-ui/api/toggle-button.js | 10 ++++++---- docs/pages/material-ui/api/toolbar.js | 10 ++++++---- docs/pages/material-ui/api/tooltip.js | 10 ++++++---- docs/pages/material-ui/api/tree-item.js | 10 ++++++---- docs/pages/material-ui/api/tree-view.js | 10 ++++++---- docs/pages/material-ui/api/typography.js | 10 ++++++---- docs/pages/material-ui/api/zoom.js | 10 ++++++---- docs/pages/system/api/box.js | 10 ++++++---- docs/pages/system/api/container.js | 10 ++++++---- docs/pages/system/api/grid.js | 10 ++++++---- docs/pages/versions.js | 6 +++--- docs/scripts/ApiBuilders/ComponentApiBuilder.ts | 8 +++++--- 168 files changed, 1003 insertions(+), 669 deletions(-) diff --git a/docs/pages/base/api/badge-unstyled.js b/docs/pages/base/api/badge-unstyled.js index 234216cbd1bc4b..9bf50b1f0f124c 100644 --- a/docs/pages/base/api/badge-unstyled.js +++ b/docs/pages/base/api/badge-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/badge-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/button-unstyled.js b/docs/pages/base/api/button-unstyled.js index 605eb23e3441eb..b6adfa3ff23202 100644 --- a/docs/pages/base/api/button-unstyled.js +++ b/docs/pages/base/api/button-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/button-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/click-away-listener.js b/docs/pages/base/api/click-away-listener.js index 645809e4914b80..a4967985b657b0 100644 --- a/docs/pages/base/api/click-away-listener.js +++ b/docs/pages/base/api/click-away-listener.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/click-away-listener', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/form-control-unstyled.js b/docs/pages/base/api/form-control-unstyled.js index 89e3c502bdf03b..dc174a8c9ed5e2 100644 --- a/docs/pages/base/api/form-control-unstyled.js +++ b/docs/pages/base/api/form-control-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/form-control-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/input-unstyled.js b/docs/pages/base/api/input-unstyled.js index 984dca27eea84c..fde6781ee373bc 100644 --- a/docs/pages/base/api/input-unstyled.js +++ b/docs/pages/base/api/input-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/input-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/menu-item-unstyled.js b/docs/pages/base/api/menu-item-unstyled.js index 810251bfa4a63b..1167c76e0714bd 100644 --- a/docs/pages/base/api/menu-item-unstyled.js +++ b/docs/pages/base/api/menu-item-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/menu-item-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/menu-unstyled.js b/docs/pages/base/api/menu-unstyled.js index 8b6d8ac2901057..624de2e9f3a959 100644 --- a/docs/pages/base/api/menu-unstyled.js +++ b/docs/pages/base/api/menu-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/menu-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/modal-unstyled.js b/docs/pages/base/api/modal-unstyled.js index ace2b24794a016..63b5017be3c1ef 100644 --- a/docs/pages/base/api/modal-unstyled.js +++ b/docs/pages/base/api/modal-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/modal-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/multi-select-unstyled.js b/docs/pages/base/api/multi-select-unstyled.js index aa99fc89b28b45..2a3e10678b5321 100644 --- a/docs/pages/base/api/multi-select-unstyled.js +++ b/docs/pages/base/api/multi-select-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/multi-select-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/no-ssr.js b/docs/pages/base/api/no-ssr.js index c42531ff92d7c0..c86d94112a62c3 100644 --- a/docs/pages/base/api/no-ssr.js +++ b/docs/pages/base/api/no-ssr.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/no-ssr', false, /no-ssr.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/option-group-unstyled.js b/docs/pages/base/api/option-group-unstyled.js index f213d581bd8812..14d1d4fd58821d 100644 --- a/docs/pages/base/api/option-group-unstyled.js +++ b/docs/pages/base/api/option-group-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/option-group-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/option-unstyled.js b/docs/pages/base/api/option-unstyled.js index 7c14dbcda7ef36..a28d07a3e3ed15 100644 --- a/docs/pages/base/api/option-unstyled.js +++ b/docs/pages/base/api/option-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/option-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/popper-unstyled.js b/docs/pages/base/api/popper-unstyled.js index d1b2de9cd406fa..8aad114fbd477f 100644 --- a/docs/pages/base/api/popper-unstyled.js +++ b/docs/pages/base/api/popper-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/popper-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/portal.js b/docs/pages/base/api/portal.js index 485c5672899635..ecb3acee2fb18a 100644 --- a/docs/pages/base/api/portal.js +++ b/docs/pages/base/api/portal.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/portal', false, /portal.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/select-unstyled.js b/docs/pages/base/api/select-unstyled.js index 71d1dc6fdb413e..d4acf1f5e532d0 100644 --- a/docs/pages/base/api/select-unstyled.js +++ b/docs/pages/base/api/select-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/select-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/slider-unstyled.js b/docs/pages/base/api/slider-unstyled.js index 5c255387f8e51f..f21f7d4828f12f 100644 --- a/docs/pages/base/api/slider-unstyled.js +++ b/docs/pages/base/api/slider-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/slider-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/switch-unstyled.js b/docs/pages/base/api/switch-unstyled.js index cfe5e8e70f3db4..f12995f631043e 100644 --- a/docs/pages/base/api/switch-unstyled.js +++ b/docs/pages/base/api/switch-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/switch-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/tab-panel-unstyled.js b/docs/pages/base/api/tab-panel-unstyled.js index 12a5b9586d592f..c0391eb008db2c 100644 --- a/docs/pages/base/api/tab-panel-unstyled.js +++ b/docs/pages/base/api/tab-panel-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/tab-panel-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/tab-unstyled.js b/docs/pages/base/api/tab-unstyled.js index b0bf7442567e27..3f905b498afae9 100644 --- a/docs/pages/base/api/tab-unstyled.js +++ b/docs/pages/base/api/tab-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/tab-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/table-pagination-unstyled.js b/docs/pages/base/api/table-pagination-unstyled.js index 84e0d3e2c9a051..0e0a470b51b337 100644 --- a/docs/pages/base/api/table-pagination-unstyled.js +++ b/docs/pages/base/api/table-pagination-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/table-pagination-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/tabs-list-unstyled.js b/docs/pages/base/api/tabs-list-unstyled.js index 0c5a0022400b6c..81b93ca9d483bc 100644 --- a/docs/pages/base/api/tabs-list-unstyled.js +++ b/docs/pages/base/api/tabs-list-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/tabs-list-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/tabs-unstyled.js b/docs/pages/base/api/tabs-unstyled.js index 57b993f18feb4f..508d819368e26a 100644 --- a/docs/pages/base/api/tabs-unstyled.js +++ b/docs/pages/base/api/tabs-unstyled.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/tabs-unstyled', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/textarea-autosize.js b/docs/pages/base/api/textarea-autosize.js index 9dff1a94149c5d..4e8c17b0aea99a 100644 --- a/docs/pages/base/api/textarea-autosize.js +++ b/docs/pages/base/api/textarea-autosize.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/textarea-autosize', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/base/api/trap-focus.js b/docs/pages/base/api/trap-focus.js index 793687f6e9e022..dd578e81873e69 100644 --- a/docs/pages/base/api/trap-focus.js +++ b/docs/pages/base/api/trap-focus.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/trap-focus', false, /trap-focus.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/experiments/index.js b/docs/pages/experiments/index.js index bac1aa877e6c4d..5a17de33c11a35 100644 --- a/docs/pages/experiments/index.js +++ b/docs/pages/experiments/index.js @@ -142,7 +142,7 @@ export default function Experiments({ experiments }) { ); } -Experiments.getInitialProps = () => { +export function getStaticProps() { const experiments = []; const req = require.context('./', true, /^\.\/.*(? { }); return { - experiments, + props: { + experiments, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/accordion-actions.js b/docs/pages/material-ui/api/accordion-actions.js index 13a77185c60034..368be379ae33d2 100644 --- a/docs/pages/material-ui/api/accordion-actions.js +++ b/docs/pages/material-ui/api/accordion-actions.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/accordion-actions', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/accordion-details.js b/docs/pages/material-ui/api/accordion-details.js index 45a6e6c1a1dd27..7ca7b91532734a 100644 --- a/docs/pages/material-ui/api/accordion-details.js +++ b/docs/pages/material-ui/api/accordion-details.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/accordion-details', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/accordion-summary.js b/docs/pages/material-ui/api/accordion-summary.js index 6a839d5299092b..7a9b2f38e93c45 100644 --- a/docs/pages/material-ui/api/accordion-summary.js +++ b/docs/pages/material-ui/api/accordion-summary.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/accordion-summary', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/accordion.js b/docs/pages/material-ui/api/accordion.js index e7c7493341e74e..04468916dcd827 100644 --- a/docs/pages/material-ui/api/accordion.js +++ b/docs/pages/material-ui/api/accordion.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/accordion', false, /accordion.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/alert-title.js b/docs/pages/material-ui/api/alert-title.js index 4f2857a425a848..2809607ac65e9d 100644 --- a/docs/pages/material-ui/api/alert-title.js +++ b/docs/pages/material-ui/api/alert-title.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/alert-title', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/alert.js b/docs/pages/material-ui/api/alert.js index f676f9ab4475f1..cf3d335326169e 100644 --- a/docs/pages/material-ui/api/alert.js +++ b/docs/pages/material-ui/api/alert.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/alert', false, /alert.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/app-bar.js b/docs/pages/material-ui/api/app-bar.js index 8561ec72d598ca..2fc1bda0a798d7 100644 --- a/docs/pages/material-ui/api/app-bar.js +++ b/docs/pages/material-ui/api/app-bar.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/app-bar', false, /app-bar.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/autocomplete.js b/docs/pages/material-ui/api/autocomplete.js index ea7bc74e15919f..9d604253f75a6f 100644 --- a/docs/pages/material-ui/api/autocomplete.js +++ b/docs/pages/material-ui/api/autocomplete.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/autocomplete', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/avatar-group.js b/docs/pages/material-ui/api/avatar-group.js index b1e7dd07841f4d..ec82ce99ec0a86 100644 --- a/docs/pages/material-ui/api/avatar-group.js +++ b/docs/pages/material-ui/api/avatar-group.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/avatar-group', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/avatar.js b/docs/pages/material-ui/api/avatar.js index ff34aacf10fd9a..ce097abfa6432d 100644 --- a/docs/pages/material-ui/api/avatar.js +++ b/docs/pages/material-ui/api/avatar.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/avatar', false, /avatar.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/backdrop.js b/docs/pages/material-ui/api/backdrop.js index baf12c7816e927..ad0bf49abb7a26 100644 --- a/docs/pages/material-ui/api/backdrop.js +++ b/docs/pages/material-ui/api/backdrop.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/backdrop', false, /backdrop.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/badge.js b/docs/pages/material-ui/api/badge.js index 18d7387490b512..7581ca40156cca 100644 --- a/docs/pages/material-ui/api/badge.js +++ b/docs/pages/material-ui/api/badge.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/badge', false, /badge.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/bottom-navigation-action.js b/docs/pages/material-ui/api/bottom-navigation-action.js index ab6be65e640c4b..7ffb7a7d29df60 100644 --- a/docs/pages/material-ui/api/bottom-navigation-action.js +++ b/docs/pages/material-ui/api/bottom-navigation-action.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/bottom-navigation-action', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/bottom-navigation.js b/docs/pages/material-ui/api/bottom-navigation.js index 7f3a08fc9be03b..b0c983658a4f5d 100644 --- a/docs/pages/material-ui/api/bottom-navigation.js +++ b/docs/pages/material-ui/api/bottom-navigation.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/bottom-navigation', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/box.js b/docs/pages/material-ui/api/box.js index 75bdf6fcffccf1..6f739227cc0484 100644 --- a/docs/pages/material-ui/api/box.js +++ b/docs/pages/material-ui/api/box.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/box', false, /box.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/breadcrumbs.js b/docs/pages/material-ui/api/breadcrumbs.js index 4fe89696f281ae..74cd0bbd6219b3 100644 --- a/docs/pages/material-ui/api/breadcrumbs.js +++ b/docs/pages/material-ui/api/breadcrumbs.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/breadcrumbs', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/button-base.js b/docs/pages/material-ui/api/button-base.js index 7009686d56d9a6..91b140d1f66b34 100644 --- a/docs/pages/material-ui/api/button-base.js +++ b/docs/pages/material-ui/api/button-base.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/button-base', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/button-group.js b/docs/pages/material-ui/api/button-group.js index 299fc115987c7d..8f19dedb45f682 100644 --- a/docs/pages/material-ui/api/button-group.js +++ b/docs/pages/material-ui/api/button-group.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/button-group', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/button.js b/docs/pages/material-ui/api/button.js index 66ad9f22ef0c47..ec97c5f71368dc 100644 --- a/docs/pages/material-ui/api/button.js +++ b/docs/pages/material-ui/api/button.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/button', false, /button.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/card-action-area.js b/docs/pages/material-ui/api/card-action-area.js index 2d5d48421a9fe8..58495414672f5b 100644 --- a/docs/pages/material-ui/api/card-action-area.js +++ b/docs/pages/material-ui/api/card-action-area.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/card-action-area', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/card-actions.js b/docs/pages/material-ui/api/card-actions.js index 5ddab04b03f55d..1fcc698950f199 100644 --- a/docs/pages/material-ui/api/card-actions.js +++ b/docs/pages/material-ui/api/card-actions.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/card-actions', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/card-content.js b/docs/pages/material-ui/api/card-content.js index f8529aba2bbde4..d20f2bee277853 100644 --- a/docs/pages/material-ui/api/card-content.js +++ b/docs/pages/material-ui/api/card-content.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/card-content', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/card-header.js b/docs/pages/material-ui/api/card-header.js index 30f53f92e8afb4..74807870b255aa 100644 --- a/docs/pages/material-ui/api/card-header.js +++ b/docs/pages/material-ui/api/card-header.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/card-header', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/card-media.js b/docs/pages/material-ui/api/card-media.js index 44b47d5b087acd..d36ed6e8c36f94 100644 --- a/docs/pages/material-ui/api/card-media.js +++ b/docs/pages/material-ui/api/card-media.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/card-media', false, /card-media.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/card.js b/docs/pages/material-ui/api/card.js index 91bcc50d89eac4..8dfbced16f3db9 100644 --- a/docs/pages/material-ui/api/card.js +++ b/docs/pages/material-ui/api/card.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/card', false, /card.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/checkbox.js b/docs/pages/material-ui/api/checkbox.js index 90a006ee745260..17a6232cee7060 100644 --- a/docs/pages/material-ui/api/checkbox.js +++ b/docs/pages/material-ui/api/checkbox.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/checkbox', false, /checkbox.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/chip.js b/docs/pages/material-ui/api/chip.js index dce59e6ca9c489..e5c084d1637bdd 100644 --- a/docs/pages/material-ui/api/chip.js +++ b/docs/pages/material-ui/api/chip.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/chip', false, /chip.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/circular-progress.js b/docs/pages/material-ui/api/circular-progress.js index 3c1f447e891e4d..47f710bd81d3b1 100644 --- a/docs/pages/material-ui/api/circular-progress.js +++ b/docs/pages/material-ui/api/circular-progress.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/circular-progress', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/collapse.js b/docs/pages/material-ui/api/collapse.js index 0f082f387e96ba..6f01a1ee5a93fc 100644 --- a/docs/pages/material-ui/api/collapse.js +++ b/docs/pages/material-ui/api/collapse.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/collapse', false, /collapse.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/container.js b/docs/pages/material-ui/api/container.js index 93a80589d308f5..362006264bf631 100644 --- a/docs/pages/material-ui/api/container.js +++ b/docs/pages/material-ui/api/container.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/container', false, /container.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/css-baseline.js b/docs/pages/material-ui/api/css-baseline.js index 6bb60d8ee9f04c..29aee4db28aa70 100644 --- a/docs/pages/material-ui/api/css-baseline.js +++ b/docs/pages/material-ui/api/css-baseline.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/css-baseline', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/dialog-actions.js b/docs/pages/material-ui/api/dialog-actions.js index e8496d951c3a47..86f3f844289b07 100644 --- a/docs/pages/material-ui/api/dialog-actions.js +++ b/docs/pages/material-ui/api/dialog-actions.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/dialog-actions', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/dialog-content-text.js b/docs/pages/material-ui/api/dialog-content-text.js index ad681a675de8aa..e51d83bade06f2 100644 --- a/docs/pages/material-ui/api/dialog-content-text.js +++ b/docs/pages/material-ui/api/dialog-content-text.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/dialog-content-text', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/dialog-content.js b/docs/pages/material-ui/api/dialog-content.js index 8d5c951eb5ded3..cebbec2363467e 100644 --- a/docs/pages/material-ui/api/dialog-content.js +++ b/docs/pages/material-ui/api/dialog-content.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/dialog-content', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/dialog-title.js b/docs/pages/material-ui/api/dialog-title.js index c2c903c68af88f..50c17cdee1ee91 100644 --- a/docs/pages/material-ui/api/dialog-title.js +++ b/docs/pages/material-ui/api/dialog-title.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/dialog-title', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/dialog.js b/docs/pages/material-ui/api/dialog.js index a6778ff8d9522a..b4a22e84fb838c 100644 --- a/docs/pages/material-ui/api/dialog.js +++ b/docs/pages/material-ui/api/dialog.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/dialog', false, /dialog.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/divider.js b/docs/pages/material-ui/api/divider.js index 72044e9d17d343..e9fe580e694b6b 100644 --- a/docs/pages/material-ui/api/divider.js +++ b/docs/pages/material-ui/api/divider.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/divider', false, /divider.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/drawer.js b/docs/pages/material-ui/api/drawer.js index 9d101af9bb255f..360df19f6c0b27 100644 --- a/docs/pages/material-ui/api/drawer.js +++ b/docs/pages/material-ui/api/drawer.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/drawer', false, /drawer.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/fab.js b/docs/pages/material-ui/api/fab.js index 87c27f69a4af94..c6d09e70ce65ab 100644 --- a/docs/pages/material-ui/api/fab.js +++ b/docs/pages/material-ui/api/fab.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/fab', false, /fab.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/fade.js b/docs/pages/material-ui/api/fade.js index 432e7f2dba55f8..5f80f93bcc3896 100644 --- a/docs/pages/material-ui/api/fade.js +++ b/docs/pages/material-ui/api/fade.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/fade', false, /fade.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/filled-input.js b/docs/pages/material-ui/api/filled-input.js index 60a02594773f1e..843516e7c7efa4 100644 --- a/docs/pages/material-ui/api/filled-input.js +++ b/docs/pages/material-ui/api/filled-input.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/filled-input', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/form-control-label.js b/docs/pages/material-ui/api/form-control-label.js index 1e6dd123900dc4..5841162e25c8a3 100644 --- a/docs/pages/material-ui/api/form-control-label.js +++ b/docs/pages/material-ui/api/form-control-label.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/form-control-label', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/form-control.js b/docs/pages/material-ui/api/form-control.js index 380d4f46e73625..93b055ddb31382 100644 --- a/docs/pages/material-ui/api/form-control.js +++ b/docs/pages/material-ui/api/form-control.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/form-control', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/form-group.js b/docs/pages/material-ui/api/form-group.js index 566fe3c5a58228..ec99895ee703b1 100644 --- a/docs/pages/material-ui/api/form-group.js +++ b/docs/pages/material-ui/api/form-group.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/form-group', false, /form-group.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/form-helper-text.js b/docs/pages/material-ui/api/form-helper-text.js index f90e49d2cff7d3..f57804e6a069e8 100644 --- a/docs/pages/material-ui/api/form-helper-text.js +++ b/docs/pages/material-ui/api/form-helper-text.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/form-helper-text', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/form-label.js b/docs/pages/material-ui/api/form-label.js index 029a4b5d721a95..f718a87955a41a 100644 --- a/docs/pages/material-ui/api/form-label.js +++ b/docs/pages/material-ui/api/form-label.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/form-label', false, /form-label.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/global-styles.js b/docs/pages/material-ui/api/global-styles.js index 6bdec72a6ca6ca..3d0280af7db105 100644 --- a/docs/pages/material-ui/api/global-styles.js +++ b/docs/pages/material-ui/api/global-styles.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/global-styles', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/grid.js b/docs/pages/material-ui/api/grid.js index 1296f5b5bebc49..353fd225d3da0c 100644 --- a/docs/pages/material-ui/api/grid.js +++ b/docs/pages/material-ui/api/grid.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/grid', false, /grid.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/grow.js b/docs/pages/material-ui/api/grow.js index 1df51b550b946d..80f767b8578f97 100644 --- a/docs/pages/material-ui/api/grow.js +++ b/docs/pages/material-ui/api/grow.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/grow', false, /grow.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/hidden.js b/docs/pages/material-ui/api/hidden.js index f04b85a8271521..217c7f135626bd 100644 --- a/docs/pages/material-ui/api/hidden.js +++ b/docs/pages/material-ui/api/hidden.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/hidden', false, /hidden.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/icon-button.js b/docs/pages/material-ui/api/icon-button.js index 8d880c94791f40..76c5c3e39ecd1e 100644 --- a/docs/pages/material-ui/api/icon-button.js +++ b/docs/pages/material-ui/api/icon-button.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/icon-button', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/icon.js b/docs/pages/material-ui/api/icon.js index be7ffef1ccf73e..5ff405a5fab9a6 100644 --- a/docs/pages/material-ui/api/icon.js +++ b/docs/pages/material-ui/api/icon.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/icon', false, /icon.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/image-list-item-bar.js b/docs/pages/material-ui/api/image-list-item-bar.js index 5211ac3a86feab..4fde37728835e1 100644 --- a/docs/pages/material-ui/api/image-list-item-bar.js +++ b/docs/pages/material-ui/api/image-list-item-bar.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/image-list-item-bar', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/image-list-item.js b/docs/pages/material-ui/api/image-list-item.js index 673fbd583080d8..168d58582f99e6 100644 --- a/docs/pages/material-ui/api/image-list-item.js +++ b/docs/pages/material-ui/api/image-list-item.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/image-list-item', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/image-list.js b/docs/pages/material-ui/api/image-list.js index a73f16c7ca19e3..bdb0b7173fda1e 100644 --- a/docs/pages/material-ui/api/image-list.js +++ b/docs/pages/material-ui/api/image-list.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/image-list', false, /image-list.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/input-adornment.js b/docs/pages/material-ui/api/input-adornment.js index 993bcbc2de6bce..bc81eb4120d6d3 100644 --- a/docs/pages/material-ui/api/input-adornment.js +++ b/docs/pages/material-ui/api/input-adornment.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/input-adornment', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/input-base.js b/docs/pages/material-ui/api/input-base.js index 88dd5eb750bb20..421fe0f0735864 100644 --- a/docs/pages/material-ui/api/input-base.js +++ b/docs/pages/material-ui/api/input-base.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/input-base', false, /input-base.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/input-label.js b/docs/pages/material-ui/api/input-label.js index 7cb3db0b533243..70dd6444fb475e 100644 --- a/docs/pages/material-ui/api/input-label.js +++ b/docs/pages/material-ui/api/input-label.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/input-label', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/input.js b/docs/pages/material-ui/api/input.js index e23210a40a1e98..daaf5bd4c59f62 100644 --- a/docs/pages/material-ui/api/input.js +++ b/docs/pages/material-ui/api/input.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/input', false, /input.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/linear-progress.js b/docs/pages/material-ui/api/linear-progress.js index 9a53abc65ef7bf..1ba554889e6013 100644 --- a/docs/pages/material-ui/api/linear-progress.js +++ b/docs/pages/material-ui/api/linear-progress.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/linear-progress', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/link.js b/docs/pages/material-ui/api/link.js index 169cf91892fca4..537d03202c2b15 100644 --- a/docs/pages/material-ui/api/link.js +++ b/docs/pages/material-ui/api/link.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/link', false, /link.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/list-item-avatar.js b/docs/pages/material-ui/api/list-item-avatar.js index 3f10617d024366..5a2d834537453b 100644 --- a/docs/pages/material-ui/api/list-item-avatar.js +++ b/docs/pages/material-ui/api/list-item-avatar.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/list-item-avatar', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/list-item-button.js b/docs/pages/material-ui/api/list-item-button.js index a9307d09e55004..0832141d98a228 100644 --- a/docs/pages/material-ui/api/list-item-button.js +++ b/docs/pages/material-ui/api/list-item-button.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/list-item-button', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/list-item-icon.js b/docs/pages/material-ui/api/list-item-icon.js index 76077b18848509..3743ce765156d9 100644 --- a/docs/pages/material-ui/api/list-item-icon.js +++ b/docs/pages/material-ui/api/list-item-icon.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/list-item-icon', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/list-item-secondary-action.js b/docs/pages/material-ui/api/list-item-secondary-action.js index 2a5cc7fbb9114c..c51be71a3921b6 100644 --- a/docs/pages/material-ui/api/list-item-secondary-action.js +++ b/docs/pages/material-ui/api/list-item-secondary-action.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/list-item-secondary-action', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/list-item-text.js b/docs/pages/material-ui/api/list-item-text.js index 639bf182724fcc..7748aaaa93e299 100644 --- a/docs/pages/material-ui/api/list-item-text.js +++ b/docs/pages/material-ui/api/list-item-text.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/list-item-text', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/list-item.js b/docs/pages/material-ui/api/list-item.js index 4fc2f704505775..86522b4ff0537e 100644 --- a/docs/pages/material-ui/api/list-item.js +++ b/docs/pages/material-ui/api/list-item.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/list-item', false, /list-item.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/list-subheader.js b/docs/pages/material-ui/api/list-subheader.js index 76f688f634b7b4..6d9e0f2e372c52 100644 --- a/docs/pages/material-ui/api/list-subheader.js +++ b/docs/pages/material-ui/api/list-subheader.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/list-subheader', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/list.js b/docs/pages/material-ui/api/list.js index f9e574b5dd8fee..c542a9c17e5568 100644 --- a/docs/pages/material-ui/api/list.js +++ b/docs/pages/material-ui/api/list.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/list', false, /list.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/loading-button.js b/docs/pages/material-ui/api/loading-button.js index 3269e76e297553..55d77b0dfd1fbd 100644 --- a/docs/pages/material-ui/api/loading-button.js +++ b/docs/pages/material-ui/api/loading-button.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/loading-button', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/masonry.js b/docs/pages/material-ui/api/masonry.js index 6fb94801e7b9ea..8432d2ce64579d 100644 --- a/docs/pages/material-ui/api/masonry.js +++ b/docs/pages/material-ui/api/masonry.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/masonry', false, /masonry.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/menu-item.js b/docs/pages/material-ui/api/menu-item.js index 0ade9979d879a0..194b7007d90421 100644 --- a/docs/pages/material-ui/api/menu-item.js +++ b/docs/pages/material-ui/api/menu-item.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/menu-item', false, /menu-item.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/menu-list.js b/docs/pages/material-ui/api/menu-list.js index 98269ca9d3408e..a53e52c29ef6ee 100644 --- a/docs/pages/material-ui/api/menu-list.js +++ b/docs/pages/material-ui/api/menu-list.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/menu-list', false, /menu-list.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/menu.js b/docs/pages/material-ui/api/menu.js index 7ed6ff1f4cf692..cb2b824c0be7bb 100644 --- a/docs/pages/material-ui/api/menu.js +++ b/docs/pages/material-ui/api/menu.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/menu', false, /menu.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/mobile-stepper.js b/docs/pages/material-ui/api/mobile-stepper.js index 01bed42f214cc9..d79075b92d6ad8 100644 --- a/docs/pages/material-ui/api/mobile-stepper.js +++ b/docs/pages/material-ui/api/mobile-stepper.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/mobile-stepper', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/modal.js b/docs/pages/material-ui/api/modal.js index d3c0a292b31b49..6f4626d91fd3a5 100644 --- a/docs/pages/material-ui/api/modal.js +++ b/docs/pages/material-ui/api/modal.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/modal', false, /modal.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/native-select.js b/docs/pages/material-ui/api/native-select.js index 604a6d7c171740..7b1143a44a0b81 100644 --- a/docs/pages/material-ui/api/native-select.js +++ b/docs/pages/material-ui/api/native-select.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/native-select', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/outlined-input.js b/docs/pages/material-ui/api/outlined-input.js index 3386ca24b906da..3fba5f42dc1319 100644 --- a/docs/pages/material-ui/api/outlined-input.js +++ b/docs/pages/material-ui/api/outlined-input.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/outlined-input', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/pagination-item.js b/docs/pages/material-ui/api/pagination-item.js index 9bb2f1c0aa96eb..8fd74fcc53bcb7 100644 --- a/docs/pages/material-ui/api/pagination-item.js +++ b/docs/pages/material-ui/api/pagination-item.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/pagination-item', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/pagination.js b/docs/pages/material-ui/api/pagination.js index a7282b3205e749..f87172c988ae17 100644 --- a/docs/pages/material-ui/api/pagination.js +++ b/docs/pages/material-ui/api/pagination.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/pagination', false, /pagination.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/paper.js b/docs/pages/material-ui/api/paper.js index 2878477b12da74..5001b26b1eb9bc 100644 --- a/docs/pages/material-ui/api/paper.js +++ b/docs/pages/material-ui/api/paper.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/paper', false, /paper.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/popover.js b/docs/pages/material-ui/api/popover.js index 63e6c5e91b1102..09d45485556d24 100644 --- a/docs/pages/material-ui/api/popover.js +++ b/docs/pages/material-ui/api/popover.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/popover', false, /popover.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/popper.js b/docs/pages/material-ui/api/popper.js index 9bc6080274a4ed..19b66de068bc7f 100644 --- a/docs/pages/material-ui/api/popper.js +++ b/docs/pages/material-ui/api/popper.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/popper', false, /popper.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/radio-group.js b/docs/pages/material-ui/api/radio-group.js index 3a7599262211b2..bf59e815174c94 100644 --- a/docs/pages/material-ui/api/radio-group.js +++ b/docs/pages/material-ui/api/radio-group.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/radio-group', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/radio.js b/docs/pages/material-ui/api/radio.js index f0280245c1d835..b40841d28421f5 100644 --- a/docs/pages/material-ui/api/radio.js +++ b/docs/pages/material-ui/api/radio.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/radio', false, /radio.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/rating.js b/docs/pages/material-ui/api/rating.js index 3b54bbdd3490c1..646155c9c973e3 100644 --- a/docs/pages/material-ui/api/rating.js +++ b/docs/pages/material-ui/api/rating.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/rating', false, /rating.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/scoped-css-baseline.js b/docs/pages/material-ui/api/scoped-css-baseline.js index 4cbb0177db7fc6..f85c7aaa95df60 100644 --- a/docs/pages/material-ui/api/scoped-css-baseline.js +++ b/docs/pages/material-ui/api/scoped-css-baseline.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/scoped-css-baseline', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/select.js b/docs/pages/material-ui/api/select.js index 42e65d0af26441..698e559e11724f 100644 --- a/docs/pages/material-ui/api/select.js +++ b/docs/pages/material-ui/api/select.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/select', false, /select.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/skeleton.js b/docs/pages/material-ui/api/skeleton.js index fb52430c6430f0..3f40ce09e79edf 100644 --- a/docs/pages/material-ui/api/skeleton.js +++ b/docs/pages/material-ui/api/skeleton.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/skeleton', false, /skeleton.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/slide.js b/docs/pages/material-ui/api/slide.js index 1308dc23f43410..680d08a25a970d 100644 --- a/docs/pages/material-ui/api/slide.js +++ b/docs/pages/material-ui/api/slide.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/slide', false, /slide.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/slider.js b/docs/pages/material-ui/api/slider.js index 768c767c931f60..4021ebfec4f2fa 100644 --- a/docs/pages/material-ui/api/slider.js +++ b/docs/pages/material-ui/api/slider.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/slider', false, /slider.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/snackbar-content.js b/docs/pages/material-ui/api/snackbar-content.js index 13a17ab78660a8..154e27f05517bb 100644 --- a/docs/pages/material-ui/api/snackbar-content.js +++ b/docs/pages/material-ui/api/snackbar-content.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/snackbar-content', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/snackbar.js b/docs/pages/material-ui/api/snackbar.js index bb2bdd8f5ef3c5..8c2f6a10b7cecf 100644 --- a/docs/pages/material-ui/api/snackbar.js +++ b/docs/pages/material-ui/api/snackbar.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/snackbar', false, /snackbar.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/speed-dial-action.js b/docs/pages/material-ui/api/speed-dial-action.js index bf366ee0e297b6..69143dbf183007 100644 --- a/docs/pages/material-ui/api/speed-dial-action.js +++ b/docs/pages/material-ui/api/speed-dial-action.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/speed-dial-action', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/speed-dial-icon.js b/docs/pages/material-ui/api/speed-dial-icon.js index 8e5990357a5ce5..66534857178b7b 100644 --- a/docs/pages/material-ui/api/speed-dial-icon.js +++ b/docs/pages/material-ui/api/speed-dial-icon.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/speed-dial-icon', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/speed-dial.js b/docs/pages/material-ui/api/speed-dial.js index 5fc513d50aa52c..c1b27b6d14cc20 100644 --- a/docs/pages/material-ui/api/speed-dial.js +++ b/docs/pages/material-ui/api/speed-dial.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/speed-dial', false, /speed-dial.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/stack.js b/docs/pages/material-ui/api/stack.js index 9544e37c5e9ad1..2f490a542f2b54 100644 --- a/docs/pages/material-ui/api/stack.js +++ b/docs/pages/material-ui/api/stack.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/stack', false, /stack.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/step-button.js b/docs/pages/material-ui/api/step-button.js index 6b31dd5f831881..f6e22746db6a62 100644 --- a/docs/pages/material-ui/api/step-button.js +++ b/docs/pages/material-ui/api/step-button.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/step-button', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/step-connector.js b/docs/pages/material-ui/api/step-connector.js index 45facf4e996839..0a21525206ca49 100644 --- a/docs/pages/material-ui/api/step-connector.js +++ b/docs/pages/material-ui/api/step-connector.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/step-connector', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/step-content.js b/docs/pages/material-ui/api/step-content.js index a463bef47de7a3..f20a007212b863 100644 --- a/docs/pages/material-ui/api/step-content.js +++ b/docs/pages/material-ui/api/step-content.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/step-content', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/step-icon.js b/docs/pages/material-ui/api/step-icon.js index ea3a730f8bb5d1..9c13a49c34a3c0 100644 --- a/docs/pages/material-ui/api/step-icon.js +++ b/docs/pages/material-ui/api/step-icon.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/step-icon', false, /step-icon.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/step-label.js b/docs/pages/material-ui/api/step-label.js index b9fee317f42de2..abc53efe4a3798 100644 --- a/docs/pages/material-ui/api/step-label.js +++ b/docs/pages/material-ui/api/step-label.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/step-label', false, /step-label.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/step.js b/docs/pages/material-ui/api/step.js index 92bdaa5be69963..da0b7c1fb4e45e 100644 --- a/docs/pages/material-ui/api/step.js +++ b/docs/pages/material-ui/api/step.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/step', false, /step.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/stepper.js b/docs/pages/material-ui/api/stepper.js index d8864a890c452c..37ddfa6e66de3a 100644 --- a/docs/pages/material-ui/api/stepper.js +++ b/docs/pages/material-ui/api/stepper.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/stepper', false, /stepper.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/svg-icon.js b/docs/pages/material-ui/api/svg-icon.js index 6353473c58fe18..d182aad51a939a 100644 --- a/docs/pages/material-ui/api/svg-icon.js +++ b/docs/pages/material-ui/api/svg-icon.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/svg-icon', false, /svg-icon.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/swipeable-drawer.js b/docs/pages/material-ui/api/swipeable-drawer.js index 99e68e82869ce1..0657829ba556e7 100644 --- a/docs/pages/material-ui/api/swipeable-drawer.js +++ b/docs/pages/material-ui/api/swipeable-drawer.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/swipeable-drawer', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/switch.js b/docs/pages/material-ui/api/switch.js index 6038ed77d88509..e601b164159704 100644 --- a/docs/pages/material-ui/api/switch.js +++ b/docs/pages/material-ui/api/switch.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/switch', false, /switch.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/tab-context.js b/docs/pages/material-ui/api/tab-context.js index 6804bbf50e0f4a..f3dbfd2a58e9bb 100644 --- a/docs/pages/material-ui/api/tab-context.js +++ b/docs/pages/material-ui/api/tab-context.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/tab-context', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/tab-list.js b/docs/pages/material-ui/api/tab-list.js index 922412b7c1ed55..68417d619270c3 100644 --- a/docs/pages/material-ui/api/tab-list.js +++ b/docs/pages/material-ui/api/tab-list.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/tab-list', false, /tab-list.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/tab-panel.js b/docs/pages/material-ui/api/tab-panel.js index f7a6710df28eb8..b009942ebe9638 100644 --- a/docs/pages/material-ui/api/tab-panel.js +++ b/docs/pages/material-ui/api/tab-panel.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/tab-panel', false, /tab-panel.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/tab-scroll-button.js b/docs/pages/material-ui/api/tab-scroll-button.js index 783de4c58b0f5b..83a1b1453b446b 100644 --- a/docs/pages/material-ui/api/tab-scroll-button.js +++ b/docs/pages/material-ui/api/tab-scroll-button.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/tab-scroll-button', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/tab.js b/docs/pages/material-ui/api/tab.js index 9a39374793fe55..64ad73fd83f9a2 100644 --- a/docs/pages/material-ui/api/tab.js +++ b/docs/pages/material-ui/api/tab.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/tab', false, /tab.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/table-body.js b/docs/pages/material-ui/api/table-body.js index 902358e8c62fea..d6e17709992d9e 100644 --- a/docs/pages/material-ui/api/table-body.js +++ b/docs/pages/material-ui/api/table-body.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/table-body', false, /table-body.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/table-cell.js b/docs/pages/material-ui/api/table-cell.js index 31bfb70e735a57..d837ccf250f13e 100644 --- a/docs/pages/material-ui/api/table-cell.js +++ b/docs/pages/material-ui/api/table-cell.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/table-cell', false, /table-cell.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/table-container.js b/docs/pages/material-ui/api/table-container.js index cf9838abf1150c..f84c71eb5f748e 100644 --- a/docs/pages/material-ui/api/table-container.js +++ b/docs/pages/material-ui/api/table-container.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/table-container', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/table-footer.js b/docs/pages/material-ui/api/table-footer.js index 9a912d4a8a51fd..1deb4c93220cdb 100644 --- a/docs/pages/material-ui/api/table-footer.js +++ b/docs/pages/material-ui/api/table-footer.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/table-footer', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/table-head.js b/docs/pages/material-ui/api/table-head.js index 50950a49074336..c57c0c4b2e4368 100644 --- a/docs/pages/material-ui/api/table-head.js +++ b/docs/pages/material-ui/api/table-head.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/table-head', false, /table-head.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/table-pagination.js b/docs/pages/material-ui/api/table-pagination.js index 6c8dcdb450eec1..19eac620858a98 100644 --- a/docs/pages/material-ui/api/table-pagination.js +++ b/docs/pages/material-ui/api/table-pagination.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/table-pagination', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/table-row.js b/docs/pages/material-ui/api/table-row.js index bade79be756f9d..8cebacb733b7dd 100644 --- a/docs/pages/material-ui/api/table-row.js +++ b/docs/pages/material-ui/api/table-row.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/table-row', false, /table-row.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/table-sort-label.js b/docs/pages/material-ui/api/table-sort-label.js index 82cfebad2dabe1..d1a433584b77fc 100644 --- a/docs/pages/material-ui/api/table-sort-label.js +++ b/docs/pages/material-ui/api/table-sort-label.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/table-sort-label', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/table.js b/docs/pages/material-ui/api/table.js index eac919239c9b5d..2c031f97d24ef3 100644 --- a/docs/pages/material-ui/api/table.js +++ b/docs/pages/material-ui/api/table.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/table', false, /table.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/tabs.js b/docs/pages/material-ui/api/tabs.js index 89fb45a9a0359a..bd6ee9da6ab1c0 100644 --- a/docs/pages/material-ui/api/tabs.js +++ b/docs/pages/material-ui/api/tabs.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/tabs', false, /tabs.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/text-field.js b/docs/pages/material-ui/api/text-field.js index 94cd80d46ff015..3067ff97e9374a 100644 --- a/docs/pages/material-ui/api/text-field.js +++ b/docs/pages/material-ui/api/text-field.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/text-field', false, /text-field.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/timeline-connector.js b/docs/pages/material-ui/api/timeline-connector.js index b2f58bf7606987..c79f49a048f5d0 100644 --- a/docs/pages/material-ui/api/timeline-connector.js +++ b/docs/pages/material-ui/api/timeline-connector.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/timeline-connector', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/timeline-content.js b/docs/pages/material-ui/api/timeline-content.js index 28d775509a00a3..d3e01eb3ee95bd 100644 --- a/docs/pages/material-ui/api/timeline-content.js +++ b/docs/pages/material-ui/api/timeline-content.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/timeline-content', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/timeline-dot.js b/docs/pages/material-ui/api/timeline-dot.js index 5672ff09b3a4dc..8326abdf825de1 100644 --- a/docs/pages/material-ui/api/timeline-dot.js +++ b/docs/pages/material-ui/api/timeline-dot.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/timeline-dot', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/timeline-item.js b/docs/pages/material-ui/api/timeline-item.js index f7ee08585799a3..afd45680975bf2 100644 --- a/docs/pages/material-ui/api/timeline-item.js +++ b/docs/pages/material-ui/api/timeline-item.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/timeline-item', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/timeline-opposite-content.js b/docs/pages/material-ui/api/timeline-opposite-content.js index f9962535c9431b..72f8e4ada43114 100644 --- a/docs/pages/material-ui/api/timeline-opposite-content.js +++ b/docs/pages/material-ui/api/timeline-opposite-content.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/timeline-opposite-content', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/timeline-separator.js b/docs/pages/material-ui/api/timeline-separator.js index 4077fa61c8348f..ff9725dd18a75b 100644 --- a/docs/pages/material-ui/api/timeline-separator.js +++ b/docs/pages/material-ui/api/timeline-separator.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/timeline-separator', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/timeline.js b/docs/pages/material-ui/api/timeline.js index 5e725e38e82186..e37c79468d2f3b 100644 --- a/docs/pages/material-ui/api/timeline.js +++ b/docs/pages/material-ui/api/timeline.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/timeline', false, /timeline.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/toggle-button-group.js b/docs/pages/material-ui/api/toggle-button-group.js index 3131cde4860f2f..6d5aed6c502520 100644 --- a/docs/pages/material-ui/api/toggle-button-group.js +++ b/docs/pages/material-ui/api/toggle-button-group.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/toggle-button-group', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/toggle-button.js b/docs/pages/material-ui/api/toggle-button.js index bc1b38b54cb61e..43b01e0894c183 100644 --- a/docs/pages/material-ui/api/toggle-button.js +++ b/docs/pages/material-ui/api/toggle-button.js @@ -8,7 +8,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/toggle-button', false, @@ -17,7 +17,9 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/toolbar.js b/docs/pages/material-ui/api/toolbar.js index 277f4e2982bfda..b202069a2c5bd9 100644 --- a/docs/pages/material-ui/api/toolbar.js +++ b/docs/pages/material-ui/api/toolbar.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/toolbar', false, /toolbar.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/tooltip.js b/docs/pages/material-ui/api/tooltip.js index 83ec1312d014c9..fe41f7dfa924c2 100644 --- a/docs/pages/material-ui/api/tooltip.js +++ b/docs/pages/material-ui/api/tooltip.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/tooltip', false, /tooltip.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/tree-item.js b/docs/pages/material-ui/api/tree-item.js index 938a0e13404ecc..74778e63144656 100644 --- a/docs/pages/material-ui/api/tree-item.js +++ b/docs/pages/material-ui/api/tree-item.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/tree-item', false, /tree-item.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/tree-view.js b/docs/pages/material-ui/api/tree-view.js index 079bf4c37b3e53..c623f8094ec840 100644 --- a/docs/pages/material-ui/api/tree-view.js +++ b/docs/pages/material-ui/api/tree-view.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/tree-view', false, /tree-view.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/typography.js b/docs/pages/material-ui/api/typography.js index 5b2785af0f9655..cec9495217b858 100644 --- a/docs/pages/material-ui/api/typography.js +++ b/docs/pages/material-ui/api/typography.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/typography', false, /typography.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/material-ui/api/zoom.js b/docs/pages/material-ui/api/zoom.js index f9f68dadacc48f..ee5e9e6983587f 100644 --- a/docs/pages/material-ui/api/zoom.js +++ b/docs/pages/material-ui/api/zoom.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/zoom', false, /zoom.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/system/api/box.js b/docs/pages/system/api/box.js index 75bdf6fcffccf1..6f739227cc0484 100644 --- a/docs/pages/system/api/box.js +++ b/docs/pages/system/api/box.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/box', false, /box.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/system/api/container.js b/docs/pages/system/api/container.js index 93a80589d308f5..362006264bf631 100644 --- a/docs/pages/system/api/container.js +++ b/docs/pages/system/api/container.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/container', false, /container.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/system/api/grid.js b/docs/pages/system/api/grid.js index 1296f5b5bebc49..353fd225d3da0c 100644 --- a/docs/pages/system/api/grid.js +++ b/docs/pages/system/api/grid.js @@ -8,12 +8,14 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context('docs/translations/api-docs/grid', false, /grid.*.json$/); const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; -}; +} diff --git a/docs/pages/versions.js b/docs/pages/versions.js index 23f29a484d6346..6c2e43633f29cc 100644 --- a/docs/pages/versions.js +++ b/docs/pages/versions.js @@ -38,7 +38,7 @@ async function getBranches() { return JSON.parse(text); } -Page.getInitialProps = async () => { +export async function getStaticProps() { const FILTERED_BRANCHES = ['latest', 'l10n', 'next', 'migration', 'material-ui.com']; const branches = await getBranches(); @@ -78,5 +78,5 @@ Page.getInitialProps = async () => { }); } - return { versions: sortedUniqBy(versions, 'version') }; -}; + return { props: { versions: sortedUniqBy(versions, 'version') } }; +} diff --git a/docs/scripts/ApiBuilders/ComponentApiBuilder.ts b/docs/scripts/ApiBuilders/ComponentApiBuilder.ts index 31bff3ec8af828..9a81c7dc1a7ba3 100644 --- a/docs/scripts/ApiBuilders/ComponentApiBuilder.ts +++ b/docs/scripts/ApiBuilders/ComponentApiBuilder.ts @@ -378,7 +378,7 @@ export default function Page(props) { return ; } -Page.getInitialProps = () => { +export function getStaticProps() { const req = require.context( 'docs/translations/api-docs/${kebabCase(reactApi.name)}', false, @@ -387,8 +387,10 @@ Page.getInitialProps = () => { const descriptions = mapApiPageTranslations(req); return { - descriptions, - pageContent: jsonPageContent, + props: { + descriptions, + pageContent: jsonPageContent, + }, }; }; `.replace(/\r?\n/g, reactApi.EOL),