Skip to content

Commit

Permalink
docs: #202 add codeline highlight in Suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
minsoo-web committed Oct 20, 2023
1 parent 674f528 commit 0f5146f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/src/pages/docs/react/Suspense.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Callout } from 'nextra/components'

fallback works the same as fallback of original React's Suspense.

```tsx
```tsx /Suspense/
import { Suspense } from '@suspensive/react'

const Example = () => (
Expand All @@ -31,7 +31,7 @@ Control multiple `<Suspense/>`s default fallback with `<SuspensiveProvider/>`. D

`<Suspense.CSROnly/>` will return fallback in server. After mount(in client) return children. Since mount only happens on the client, server-side rendering can be avoided.

```tsx
```tsx /Suspense/
import { Suspense } from '@suspensive/react'

const Example = () => (
Expand All @@ -55,7 +55,7 @@ You can use withSuspense to wrap component by `<Suspense/>` easily.
we don't need to make unncessary code to wrap it if we use withSuspense like below.
withSuspense's 2nd parameter is props of `<Suspense/>` without children

```tsx
```tsx /withSuspense/
import { withSuspense } from '@suspensive/react'

const Example = withSuspense(
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/docs/react/Suspense.ko.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Callout } from 'nextra/components'

fallback은 react의 Suspense의 fallback와 동일하게 동작합니다.

```tsx
```tsx /Suspense/
import { Suspense } from '@suspensive/react'

const Example = () => (
Expand All @@ -30,7 +30,7 @@ Default fallback

`<Suspense.CSROnly/>`는 서버에서는 fallback을 반환합니다. mount 후(클라이언트에서는) children을 반환합니다. mount는 클라이언트에서만 일어나기 때문에 서버사이드 렌더링을 피할 수 있습니다.

```tsx
```tsx /Suspense/
import { Suspense } from '@suspensive/react'

const Example = () => (
Expand All @@ -54,7 +54,7 @@ withSuspense를 사용하면 컴포넌트를 `<Suspense/>`로 쉽게 래핑할
아래와 같이 withSuspense를 사용하면 이를 감싸기 위해 불필요한 코드를 만들 필요가 없습니다.
withSuspense의 두 번째 인자는 children이 없는 `<Suspense/>`의 props입니다.

```tsx
```tsx /withSuspense/
import { withSuspense } from '@suspensive/react'

const Example = withSuspense(
Expand Down

0 comments on commit 0f5146f

Please sign in to comment.