2

installing react-bootstrap straightforward;

"npm install react-bootstrap --save"

and

"npm install @types/react-bootstrap --save"

then add references

import FooButton from 'react-bootstrap/lib/Button';

..
    return (
     <div>
      <FooButton bsStyle="success" bsSize="small" >
           Nice Button
      </FooButton>
     </div>
    );

there is no error detection by typescript compiler but when I run gulp serve here its runtime exception; enter image description here

How can I fix and use react-bootstrap?

Edited: "npm view es version" output is 0.5.2 they say react-bootstrap version is es6, is it cause the error? doesn't make sense but can't figure the solution out

0

Use import * as FooButton from 'react-bootstrap/lib/Button'; to import the react-bootstrap Button component. It should render as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.