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

1 Answer 1

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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