Type | React | tcomb-react |
---|---|---|
array | array | Array |
boolean | bool | Boolean |
functions | func | Function |
numbers | number | Number |
objects | object | Object |
strings | string | String |
all | any | Any |
required prop | T.isRequired | T |
optional prop | T | maybe(T) |
custom types | ✘ | ✓ |
tuples | ✘ | tuple([T, U, ...]) |
lists | arrayOf(T) | list(T) |
instance | instanceOf(A) | T |
dictionaries | objectOf(T) | dict(T, U) (keys are checked) |
enums | oneOf(['a', 'b']) | enums.of('a b') |
unions | oneOfType([T, U]) | union([T, U]) |
duck typing | shape | struct |
react element | element | ReactElement |
react node | node | ReactNode |
react child | ✘ | ReactChild |
react children | ✘ | ReactChildren |
Created
July 13, 2018 03:07
-
-
Save xpol/d2652d60b44810b88866e0c6e445f3fb to your computer and use it in GitHub Desktop.
Tcomb React Cheat Sheet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment