From e3eace07bb35da4ccf0b8d2e2d45a38109098050 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 25 Nov 2024 08:00:49 +0900 Subject: [PATCH] docs(suspensive.org): resolve indent lint --- docs/suspensive.org/src/pages/en/index.mdx | 96 +++++++++++----------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/docs/suspensive.org/src/pages/en/index.mdx b/docs/suspensive.org/src/pages/en/index.mdx index 308c280a0..c29bf63d2 100644 --- a/docs/suspensive.org/src/pages/en/index.mdx +++ b/docs/suspensive.org/src/pages/en/index.mdx @@ -28,36 +28,36 @@ In this case, you can check `isLoading` and `isError` to handle loading and erro ```jsx ! Page.jsx const Page = () => { - const userQuery = useQuery(userQueryOptions()) - const postsQuery = useQuery({ - ...postsQueryOptions(); - select: (posts) => posts.filter(({ isPublic }) => isPublic), - }) - const promotionsQuery = useQuery(promotionsQueryOptions()) - - if ( - userQuery.isLoading || - postsQuery.isLoading || - promotionsQuery.isLoading - ) { - return 'loading...' - } - - if (userQuery.isError || postsQuery.isError || promotionsQuery.isError) { - return 'error' - } - - return ( - - - {postsQuery.data.map((post) => ( - -))} -{promotionsQuery.data.map((promotion) => ( - -))} - -) + const userQuery = useQuery(userQueryOptions()) + const postsQuery = useQuery({ + ...postsQueryOptions(), + select: (posts) => posts.filter(({ isPublic }) => isPublic), + }) + const promotionsQuery = useQuery(promotionsQueryOptions()) + + if ( + userQuery.isLoading || + postsQuery.isLoading || + promotionsQuery.isLoading + ) { + return 'loading...' + } + + if (userQuery.isError || postsQuery.isError || promotionsQuery.isError) { + return 'error' + } + + return ( + + + {postsQuery.data.map((post) => ( + + ))} + {promotionsQuery.data.map((promotion) => ( + + ))} + + ) } ``` @@ -113,33 +113,33 @@ However, since `useSuspenseQuery` is a hook, the component must be separated to ```jsx ! Page.jsx const Page = () => ( - - - - - - - + + + + + + + ) const UserInfo = ({ userId }) => { - const { data: user } = useSuspenseQuery(userQueryOptions()) - return + const { data: user } = useSuspenseQuery(userQueryOptions()) + return } const PostList = ({ userId }) => { - const { data: posts } = useSuspenseQuery({ - ...postsQueryOptions(); - select: (posts) => posts.filter(({ isPublic }) => isPublic), - }) - return posts.map((post) => ) + const { data: posts } = useSuspenseQuery({ + ...postsQueryOptions(), + select: (posts) => posts.filter(({ isPublic }) => isPublic), + }) + return posts.map((post) => ) } const PromotionList = ({ userId }) => { -const { data: promotions } = useSuspenseQuery(promotionsQueryOptions()) -return promotions.map((promotion) => ( - -)) + const { data: promotions } = useSuspenseQuery(promotionsQueryOptions()) + return promotions.map((promotion) => ( + + )) } ```