Skip to content

Instantly share code, notes, and snippets.

@xpol
Created July 13, 2018 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xpol/d2652d60b44810b88866e0c6e445f3fb to your computer and use it in GitHub Desktop.
Save xpol/d2652d60b44810b88866e0c6e445f3fb to your computer and use it in GitHub Desktop.
Tcomb React Cheat Sheet

Tcomb React Cheat Sheet

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment