Optional
DocumentCustom document
import React, {FC, ReactNode} from 'react'
import {Meta, Preloads, Styles, Scripts, State} from '@rambler-tech/react-toolkit/client'
export interface MyDocumentProps {
children: ReactNode
}
export const MyDocument: FC<MyDocumentProps> = ({children}) => (
<html lang="ru">
<head>
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<link rel="manifest" href="/manifest.json" />
<Preloads />
<link
rel="preconnect"
href="https://mc.yandex.ru"
crossOrigin="anonymous"
/>
<Styles />
</head>
<body>
{children}
<State />
<Scripts />
<script src="https://vp.rambler.ru/player/sdk.js" async />
</body>
</html>
)
Optional
LayoutCustom layout
import React, {FC, ReactNode} from 'react'
import {ThemeProvider} from 'awesome-ui'
import styles from './styles.module.css'
export interface MyLayoutProps {
children: ReactNode
}
export const MyLayout: FC<MyLayoutProps> = ({children}) => {
return (
<ThemeProvider>
<main className={styles.main}>{children}</main>
</ThemeProvider>
)
}
Routes list
import {lazy} from '@rambler-tech/react-toolkit/client'
const MainPage = lazy(() => import('./pages/main'))
const AboutPage = lazy(() => import('./pages/about'))
export const routes = [
{
path: '/',
component: MainPage
},
{
path: '/about',
component: AboutPage
}
]
Optional
scrollWhether to scroll to top on page transitions, defaults to true
Optional
transitionPage transition mode, defaults to blocked
Generated using TypeDoc
Hydrate from stream options