Skip to content

Commit

Permalink
Merge pull request #98 from akameco/fix/react-element-type
Browse files Browse the repository at this point in the history
docs(ADVANCED.md): ReactType -> ElementType
  • Loading branch information
supercrytoking authored Mar 20, 2019
2 parents 52545e2 + 53a6b11 commit 3b75709
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ export interface Props {

## `as` props (passing a component to be rendered)

`ReactType` is pretty useful to cover most types that can be passed to createElement e.g.
`ElementType` is pretty useful to cover most types that can be passed to createElement e.g.

```tsx
function PassThrough(props: { as: ReactType<any> }) {
function PassThrough(props: { as: ElementType<any> }) {
const { as: Component } = props;

return <Component />;
Expand Down Expand Up @@ -930,7 +930,7 @@ Most Commonly Used Interfaces and Types
Not Commonly Used but Good to know
- `Ref` - used to type `innerRef`
- `ReactType` - used for higher order components or operations on components
- `ElementType` - used for higher order components or operations on components
- `ComponentType` - used for higher order components where you don't specifically deal with the intrinsic components
- `ReactPortal` - used if you specifically need to type a prop as a portal, otherwise it is part of `ReactNode`
- `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
Expand All @@ -957,6 +957,7 @@ Anything not listed above is considered an internal type and not public. If you'
- `ComponentState`
- `LegacyRef`
- `StatelessComponent`
- `ReactType`
## `@types/react-dom`
Expand Down

0 comments on commit 3b75709

Please sign in to comment.