0.1.3 • Published 11 years ago
tcomb-react-bootstrap v0.1.3
% tcomb-react-bootstrap

This project adds a type checking layer to the components of react-bootstrap.
If you want to add type checking to your own React components, see here.
Playground
Try the playground here
Constraint examples
Some constraints among others enforced by this library:
Alert:onDismissanddismissAftermust either or neither passedButtonGroup: can have onlyButtonchildrenCol: props must be integers between 1 and 12Glyphicon: can't have childrenNav: bsStyle must be one ofpills,tabs
For now the constraints are quite relaxed in order to allow an easier demo, however they can be tighten up to the point of accepting only whitelisted props.
Usage
/** @jsx React.DOM */
// development
var Alert = require('tcomb-react-bootstrap/Alert');
// production
// var Alert = require('react-bootstrap/Alert');
var good = (
<Alert bsStyle="warning">
<strong>Holy guacamole!</strong>
</Alert>
); // => ok!
var bad = (
<Alert bsStyle="warn"> // <-- should be "warning"
<strong>Holy guacamole!</strong>
</Alert>
); // => fail! debugger kicks inSetup
npm install tcomb-react-bootstrap