Skip to content

Commit

Permalink
fix: scrollToTop typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Tsipotan committed Nov 14, 2023
1 parent 708d98b commit e2b8fee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/client/stream.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import {Document as BaseDocument} from '../components/document'

/** Hydrate from stream options */
export interface HydrateFromStreamOptions extends RenderOptions {
/**
* Whether to scroll to top on page transitions
* defaults to true
*/
scrollToTop?: boolean
}

Expand All @@ -31,7 +35,7 @@ export const hydrateFromStream = async (
routes,
Layout = BaseLayout,
Document = BaseDocument,
scrollToTop,
scrollToTop = true,
...rest
} = options

Expand Down
2 changes: 1 addition & 1 deletion src/components/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface RoutesProps {
}

/** Routing component with initial and meta data */
export const Routes: React.FC<RoutesProps> = ({routes, scrollToTop = true}) => {
export const Routes: React.FC<RoutesProps> = ({routes, scrollToTop}) => {
const location = useLocation()
const navigate = useNavigate()

Expand Down

0 comments on commit e2b8fee

Please sign in to comment.