You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ADVANCED.md
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -284,10 +284,10 @@ export interface Props {
284
284
285
285
## `as` props (passing a component to be rendered)
286
286
287
-
`ReactType` is pretty useful to cover most types that can be passed to createElement e.g.
287
+
`ElementType` is pretty useful to cover most types that can be passed to createElement e.g.
288
288
289
289
```tsx
290
-
function PassThrough(props: { as:ReactType<any> }) {
290
+
function PassThrough(props: { as:ElementType<any> }) {
291
291
const { as: Component } =props;
292
292
293
293
return <Component />;
@@ -930,7 +930,7 @@ Most Commonly Used Interfaces and Types
930
930
Not Commonly Used but Good to know
931
931
932
932
- `Ref` - used to type `innerRef`
933
-
- `ReactType` - used for higher order components or operations on components
933
+
- `ElementType` - used for higher order components or operations on components
934
934
- `ComponentType` - used for higher order components where you don't specifically deal with the intrinsic components
935
935
- `ReactPortal` - used if you specifically need to type a prop as a portal, otherwise it is part of `ReactNode`
936
936
- `ComponentClass` - a complete interface for the produced constructor function of a class declaration that extends `Component`, often used to type external components instead of typing your own
@@ -957,6 +957,7 @@ Anything not listed above is considered an internal type and not public. If you'
0 commit comments