Skip to content

Pagination dropdown not working Create React App #1497

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

Open
rulgf opened this issue Jul 20, 2017 · 2 comments
Open

Pagination dropdown not working Create React App #1497

rulgf opened this issue Jul 20, 2017 · 2 comments

Comments

@rulgf
Copy link

rulgf commented Jul 20, 2017

I'm having problem trying to make de pagination dropdown not working. My problem is similar to #338. I tried to import the bootstrap.js file but I'm having trouble with jquery import:

Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript

How can i achieve the dropdown to work in Create React App

versions:

"react": "^15.6.1",
"react-bootstrap-table": "^3.4.6",
@AllenFang
Copy link
Owner

@rulgf after v3.0.0, you dont need the jquery and bootstrap.js anymore. do you have repo for me to reproduce it? thanks

@maotora
Copy link

maotora commented Aug 22, 2017

Hi @rulgf ,

Umm.. this is what I did to escape the issue.

<!DOCTYPE html>
<html>
  <head>
    <title>Mijengo</title>
    <link rel="stylesheet" href="../node_modules/react-bootstrap-table/dist/react-bootstrap-table-all.min.css"/>
    <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="./styles/styles.css" />
  </head>
  <body>
    <div id="app"></div>
    <script src="./app.js" data-container="#app"></script>
    <script>
        const jQuery = require('jquery')
      if (process.env.BROWSER_SYNC_CLIENT_URL) {
        const current = document.currentScript;
        const script = document.createElement('script');
        script.src = process.env.BROWSER_SYNC_CLIENT_URL;
        script.async = true;
        current.parentNode.insertBefore(script, current);
      }
    </script>
    <script src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
  </body>
</html>

Note the require('jquery') and the variable name before sourcing bootstrap.js.

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