hkguile
hkguile

Reputation: 4359

How to import ReactBootstrap to use button in react.js

I'm using babel.js, try to import ReactBootstrap like this

const { Button } = ReactBootstrap.Button;
const { ButtonGroup } = ReactBootstrap.ButtonGroup;

Error

Uncaught ReferenceError: ReactBootstrap is not defined

how to fix it?

Upvotes: 0

Views: 193

Answers (2)

Ashish Bhardwaj
Ashish Bhardwaj

Reputation: 158

You can use the following code for importing your ReactBootstrap using ES5 syntax.

const { Button } = require("ReactBootstrap.Button");
const { ButtonGroup } = require("ReactBootstrap.ButtonGroup");

Upvotes: 0

venkatramanan
venkatramanan

Reputation: 94

Can you import like this way

  import { Button } from 'ReactBootstrap.Button'
  import { ButtonGroup } from 'ReactBootstrap.ButtonGroup'

Upvotes: 1

Related Questions