React-bootstrap elements don't have style

I am working on webapp using response.js and agent-router and webpack. I would like to use a bootstrap reaction for styling, but my navigator doesn't seem stylized, as shown here. http://react-bootstrap.imtqy.com/components.html#navbars

this is my bootstrap reaction code

<Navbar inverse fixedTop>

            <Navbar.Collapse>
            <Nav bsStyle="pills">
              <NavItem  href="#"><Link to="/">{this.state.navMenu[0] }</Link></NavItem>
              <NavItem  href="#"><Link to="/utilities">{this.state.navMenu[3] }</Link></NavItem>
              <NavItem  href="#"><Link to="/main">{this.state.navMenu[4] }</Link></NavItem>
            </Nav>             
            </Navbar.Collapse>
          </Navbar>

these are dependencies

"devDependencies": {
"babel-cli": "^6.4.0",
"babel-core": "^6.4.0",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"css-loader": "^0.23.1",
"file-loader": "^0.8.5",
"history": "^1.17.0",
"react": "^0.14.6",
"react-dom": "^0.14.6",
"style-loader": "^0.13.0",
"webpack": "^1.12.11",
"webpack-dev-server": "^1.14.1"},

  "dependencies": {
    "bootstrap": "^3.3.6",
    "imports-loader": "^0.6.5",
    "react": "^0.14.6",
    "react-bootstrap": "^0.28.2",
    "react-router": "^2.0.0-rc5"
  }

and this is webpack.config file

var webpack = require('webpack');  
module.exports = {  
    entry: [
      'babel-polyfill',
      'webpack/hot/only-dev-server',
      "./app.js",
    ],
    output: {
        path: __dirname + '/build',
        filename: "bundle.js"
    },
    module: {
        loaders: [
            { test: /\.jsx?$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/},
            { test: [/\.jsx?$/, /\.es6$/], exclude: /node_modules/, loader: 'babel-loader'  },
            { test: /\.css$/, loader: 'style!css' },
        ]
    },
     resolve: {
    // you can now require('file') instead of require('file.coffee')
    extensions: ['', '.js', '.json', '.coffee'] 
    },
    plugins: [
      new webpack.NoErrorsPlugin(),

    ]

};

Ive tried to require "bootstrap", but I get the following error message: Uncaught ReferenceError: jQuery not defined

any help is much appreciated please.

+4
source share
2 answers

bootstrap, bootstrap js ( jquery , ). bootstrap js, action-bootstrap.

css bootstrap, :

import style from 'bootstrap/dist/css/bootstrap.css';

. , bootstrap .

:

npm install --save-dev url-loader

Webpack:

{
  test: /\.(png|woff|woff2|eot|ttf|svg)$/,
  loader: 'url-loader?limit=100000'
},

css-loader. :

{ test: /\.css$/, loader: 'style!css' },
+1

: , bootstrap v3.3.7 (npm install --save bootstrap@3.3.7), 4, action-bootstrap CSS v3. , , navbar, CSS v4.

0

Source: https://habr.com/ru/post/1626698/


All Articles