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 use in ReactJS #364

Closed
sonhan opened this issue Nov 24, 2017 · 3 comments
Closed

How to use in ReactJS #364

sonhan opened this issue Nov 24, 2017 · 3 comments

Comments

@sonhan
Copy link

sonhan commented Nov 24, 2017

I've got jQuery, Bootstrap included, and Bootstrap Modal is working. But cannot find a way to use this dialog. Have any of you successfully used this dialog with ReactJS?

npm i jquery bootstrap bootstrap3-dialog

import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap3-dialog/dist/css/bootstrap-dialog.min.css';
import jQuery from 'jquery';
import BootstrapDialog from 'bootstrap3-dialog'; // I CANNOT IMPORT IT HERE
window.jQuery = jQuery;
require('bootstrap');

@sonhan
Copy link
Author

sonhan commented Nov 24, 2017

Hi, I managed to make it work by using var BootstrapDialog = require('bootstrap3-dialog');

Then here are the guidelines for React, @nakupanda it you find it useful maybe you can include it in Readme

  • Install
npm i jquery bootstrap bootstrap3-dialog
  • Included in JSX file
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap3-dialog/dist/css/bootstrap-dialog.min.css';
import jQuery from 'jquery';

window.jQuery = jQuery;
var BootstrapDialog = require('bootstrap3-dialog');
  • Use as normal
    BootstrapDialog.alert('I want banana!');

@nakupanda
Copy link
Owner

@sonhan Thank you, will include this issue in Readme.

@nakupanda
Copy link
Owner

@sonhan Included this guideline in Readme. Thank you.

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

2 participants