Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to integrate into an actual app? #14

Closed
bradens opened this issue Jan 31, 2014 · 4 comments
Closed

How to integrate into an actual app? #14

bradens opened this issue Jan 31, 2014 · 4 comments

Comments

@bradens
Copy link

bradens commented Jan 31, 2014

I am trying to get this running on my app which is using bower to import react-with-addons, and it seems to be really difficult to actually get react-bootstrap into the app. Do you have any documentation on how to import into a existing react app?

@pieterv
Copy link
Contributor

pieterv commented Feb 1, 2014

Sorry this project is still a work in progress and as a result the documentation is pretty light. But integrating react-bootstrap into an existing project should be very simple. I would expect you would need to do the following steps:

  1. bower install react-bootstrap
  2. bower install bootstrap or just copy into your project the bootstrap css file, then link it from your HTML page.
  3. Within your project code just require the component you need, for example using the alert with AMD you would var Alert = require('react-bootstrap/amd/Alert');
  4. Then you can use the components as described in the readme, like any other React component.

Is there anything in particular you are having trouble with?

@stevoland
Copy link
Contributor

Hi, sorry for the confusion but actually I haven't finished doing the AMD export yet so currently the only way to use the components is by using the commonjs modules in node
(var Alert = require('react-bootstrap/cjs/Alert');)and packaging up a browser bundle with something like browserify. I'll update this ticket when I've got the AMD export working.

@bradens
Copy link
Author

bradens commented Feb 1, 2014

Hey guys,

I guess the problem is that I include react.js in my bundled up vendor.js, which is not wrapped in cjs modules. So when I use react code i just have React defined. I tried to simply plug your cjs modules in my src directory, but there are references to modules in the react code ( ReactPropTransferer ) and that obviously breaks because I don't have the react libs anywhere.

Is there a way to have these components without requiring those inner react modules?

Just want to add that I'm really excited to use this and you have done great work!

@stevoland
Copy link
Contributor

Hi,

I've just got AMD and globals exports working I think which should solve your problems. Info here: https://github.com/stevoland/react-bootstrap#getting-started Let me know how you get on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants