Skip to main content

With

Overview​

  • This component represents a shape to be matched.
  • Its props are the pattern: the shape of value you expect for this branch.
  • Its children will be rendered if the shape defined within its other props match the value prop passed to its Match parent.
  • It takes one type parameter: the shape of the value prop passed to its parent. Useful for type inference.
  • This is pretty much a lighter version of Exact.

Examples​