Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

27 рядки
765 B

  1. import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'
  2. class MyDocument extends Document {
  3. static async getInitialProps(ctx) {
  4. const initialProps = await Document.getInitialProps(ctx);
  5. return { ...initialProps }
  6. }
  7. render() {
  8. const {locale} = this.props.__NEXT_DATA__
  9. const dir = locale === 'ar' ? 'rtl' : 'ltr';
  10. return (
  11. <Html>
  12. <Head>
  13. <link rel="icon" type="image/png" href="/images/favicon.png"></link>
  14. </Head>
  15. <body dir={dir} lang={locale}>
  16. <Main />
  17. <NextScript />
  18. </body>
  19. </Html>
  20. )
  21. }
  22. }
  23. export default MyDocument;