Home

Awesome

% tcomb-react-bootstrap

tcomb logo

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:

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 in

Setup

npm install tcomb-react-bootstrap

License (MIT)