Skip to content

Commit e05aaed

Browse files
committed
[fix] revert ISR to SSR for Lark API compatibility
1 parent f023eef commit e05aaed

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

pages/index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { observer } from 'mobx-react';
2-
import { GetStaticProps } from 'next';
2+
import { cache, compose, errorLogger } from 'next-ssr-middleware';
33
import { FC, useContext } from 'react';
44
import { Card, Col, Row } from 'react-bootstrap';
55
import { renderToStaticMarkup } from 'react-dom/server';
66
import ReactTyped from 'react-typed-component';
7-
import { Day, Second } from 'web-utility';
87

98
import { HeroCarousel } from '../components/Activity/HeroCarousel';
109
import { PageHead } from '../components/Layout/PageHead';
@@ -16,14 +15,11 @@ interface HomePageProps {
1615
activities: Activity[];
1716
}
1817

19-
export const getStaticProps: GetStaticProps<HomePageProps> = async () => {
18+
export const getServerSideProps = compose(cache(), errorLogger, async () => {
2019
const activities = await new ActivityModel().getList({}, 1, 3);
2120

22-
return {
23-
props: JSON.parse(JSON.stringify({ activities })),
24-
revalidate: Day / Second,
25-
};
26-
};
21+
return { props: JSON.parse(JSON.stringify({ activities })) };
22+
});
2723

2824
const HomePage: FC<HomePageProps> = observer(({ activities }) => {
2925
const { t } = useContext(I18nContext);

0 commit comments

Comments
 (0)