memoized 컴포넌트 타입 선언

Tags
React
설명
React.NamedExoticComponent<Props>
 
React.NamedExoticComponent 타입을 활용하면 된다. (React.memo의 반환 타입)
 
interface Props { title?: string | Element; canGoBack?: boolean; } export const AppHeader: NamedExoticComponent<Props> = memo( ({ title, canGoBack }) => { ... return(<컴포넌트 />) });