Skip to content

Commit

Permalink
[#13] 리뷰 반영: 이상한 문법을 제거합니다
Browse files Browse the repository at this point in the history
  • Loading branch information
2-one-week committed Apr 23, 2024
1 parent 312db84 commit acd6630
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions packages/react-pdf/src/components/Pages.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Fragment, memo, useCallback} from 'react'
import {Fragment, PropsWithChildren, memo, useCallback} from 'react'

import {usePdfContext} from '../contexts/pdf'
import {PageCanvas} from './page/Canvas'
Expand All @@ -8,10 +8,10 @@ export interface PagesProps {
renderMode?: 'canvas' | 'svg'
}

export const Pages = memo(function Pages({renderMode}: PagesProps) {
export const Pages = memo(function Pages({renderMode, children}: PropsWithChildren<PagesProps>) {
const {pdf} = usePdfContext()

const renderPdf = useCallback(() => {
const RenderPDF = useCallback(() => {
return Array.from({length: pdf.numPages}).map((_, index) => {
const pageNumber = index + 1
return (
Expand All @@ -23,15 +23,20 @@ export const Pages = memo(function Pages({renderMode}: PagesProps) {
})
}, [pdf.numPages, renderMode])

const renderTextLayer = useCallback(() => {}, [])
const RenderTextLayer = useCallback(() => {
return null
}, [])

const renderAnnotationLayer = useCallback(() => {}, [])
const RenderAnnotationLayer = useCallback(() => {
return null
}, [])

return (
<>
{renderPdf()}
{renderTextLayer()}
{renderAnnotationLayer()}
<RenderPDF />
<RenderTextLayer />
<RenderAnnotationLayer />
{children}
</>
)
})

0 comments on commit acd6630

Please sign in to comment.