RC
RC (React Component)の略。
コンポーネントに関する型を提供します。
children (子要素)を持つコンポーネントや独自のプロパティを持つコンポーネントの定義など に利用できます。
Type Aliases
Element
Element: ReactNode
ReactNodeのエイリアス
WithChildren
WithChildren<Props>: FC<PropsWithChildren<Props>>
子要素を持つ(childrenプロパティあり)コンポーネントの型
Example
const YourComponent: RC.WithChildren<{ value: string }> = ({ value, children }) => {
// コンポーネントの内容
}
Type parameters
| Name | Type |
|---|---|
Props | object |
WithoutChildren
WithoutChildren<Props>: FC<Props>
子要素を持たない(childrenプロパティなし)コンポーネントの型
Example
const YourComponent: RC.WithoutChildren<{ value: string }> = ({ value }) => {
// コンポーネントの内容
}
Type parameters
| Name | Type |
|---|---|
Props | object |