Version: 6.12.2
TypeScript
#
Strongly typed componentsBoth functional and class components can be typed to get the benefits of strongly typed options and props.
- Class Component
- Functional Component
#
Typed props in commandsArguments are passed to components view the passProp
. This is a common source for errors as these props tend to change overtime. Luckily we can type the passProps property to avoid these regressions. The example below shows how to declare types for passProps when pushing a screen.
The following commands accept typed passProps:
- push
- setStackRoot
- showModal
- showOverlay