Results PropTypes for React
$ npm install react-results-proptypes
; // this would be declared somewhere else in the app and importedconst MyUnion = ; const MyComponent = React;
The component above would pass checks if:
maybeAString
wereMaybe.None()
orMaybe.Some('string')
thingFromMyUnion
were any ofMyUnion.A('blah')
,MyUnion.B(42)
,MyUnion.C()