bootstrap doesn't work in my create-react-app


Thunder 54

I'm trying to render my React components using traditional bootstrap instead of react-bootstrap. I'm not sure what I'm doing wrong. I have installed bootstrap via npm and used the cdn link along with the script. I feel like I've tried everything here, but my components don't load as I want.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css"> 

<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>

Here is my component code:

import React, {Component} from "react";
export default class Home extends Component {
      render() {
      var cardStyle = {
        width: "20 rem"
      };
      return(
        <div className ="card" style = {cardStyle}>
            <img className="card-img-top" src="..." alt=""></img>
            <div className="card-block">
            <h4 className="card-title">Card title</h4>
            <p className="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
            <a href="#" className="btn btn-primary">Go somewhere</a>
            </div>
        </div>
        );      
      }
    }

My card components won't show up. Instead, I got: As you can see, how a typical boot card assembly looks

Can anyone tell me what I might be doing wrong here?

pombby

Your stylesheet is linked to bootstrap 3.3.6, but you are using cardbootstrap 4

try changing your css link

from

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">

to

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css">

Related


bootstrap doesn't work in my create-react-app

Thunder 54 I'm trying to render my React components using traditional bootstrap instead of react-bootstrap. I'm not sure what I'm doing wrong. I have installed bootstrap via npm and used the cdn link along with the script. I feel like I've tried everything her

bootstrap doesn't work in my create-react-app

Thunder 54 I'm trying to render my React components using traditional bootstrap instead of react-bootstrap. I'm not sure what I'm doing wrong. I have installed bootstrap via npm and used the cdn link along with the script. I feel like I've tried everything her

Bootstrap doesn't work, in my electron app

Lewis Codman hello i am trying to make an app with electron and integrate bootstrap. When I try the navbar (copy and paste from the document) it doesn't display well. Application screenshot After any searching, I checked my imports but everything looks normal

Fontawesome doesn't work in my React app

Dinosaur I installed font-awesome via npm. "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.15", "@fortawesome/free-solid-svg-icons": "^5.7.2", "@fortawesome/react-fontawesome": "^0.1.4", "axios": "^0.18.0",

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

Why doesn't my debounce function work in a React app with hooks?

rookie My goal is to trigger a fetch request to fetch data from the API after some delay. In my particular case, I have an input field where the user can enter the post ID. I don't want to trigger a fetch request on every number entered in the input field. I o

Routing doesn't work on load on my react native app

username I'm working on a React native project with a login system using Firebase. The login system works normally. I also managed to capture the current user id from Firebase. I tried setting "stay logged in" with the asyncStorage system and current user id.

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

Why doesn't my debounce function work in a React app with hooks?

rookie My goal is to trigger a fetch request to fetch data from the API after some delay. In my particular case, I have an input field where the user can enter the post ID. I don't want to trigger a fetch request on every number entered in the input field. I o

My default react app on Windows OS doesn't work

ali arganai I'm new to react-redux and coding in general and I'm trying to learn. So what I did: install node js 安装 npm i -g create-react-app uninstall npm uninstall -g create-react-app install npx create-react-app my-app-name cd my-react-app-name altitude sta

My custom component doesn't work in React App.js

Sukana Jana In my folder I created two components:components/ Use function-based components: import React from 'react'; const greet = () => <div className="App"><h3>Hello Sukarna Jana</h3></div>; export default greet; Using class-based components: import Re

Why doesn't my debounce function work in a React app with hooks?

rookie My goal is to trigger a fetch request to fetch data from the API after some delay. In my particular case, I have an input field where the user can enter the post ID. I don't want to trigger a fetch request on every number entered in the input field. I o

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

Routing doesn't work on load on my react native app

username I'm working on a React native project with a login system using Firebase. The login system works normally. I also managed to capture the current user id from Firebase. I tried setting "stay logged in" with the asyncStorage system and current user id.

Why doesn't my debounce function work in a React app with hooks?

rookie My goal is to trigger a fetch request to fetch data from the API after some delay. In my particular case, I have an input field where the user can enter the post ID. I don't want to trigger a fetch request on every number entered in the input field. I o

Why doesn't my debounce function work in a React app with hooks?

rookie My goal is to trigger a fetch request to fetch data from the API after some delay. In my particular case, I have an input field where the user can enter the post ID. I don't want to trigger a fetch request on every number entered in the input field. I o

React doesn't work with Bootstrap

username I'm starting a new project using Flask + React + Bootstrap, but for some reason Bootstrap in JSX is not working. I am using gulp-react to convert JSX to JS. Here's the JSX (literally an example of a bootstrap site): var Example = React.createClass({

React Create App Hot Reload doesn't always work on Linux

Challenger: I've created a React app using the create-react-app boilerplate, which seems to be popular, hot reload sometimes updates when any file changes, sometimes it doesn't, seems to have a minimum duration or something like that ,m using Ubuntu, node vers

React Create App Hot Reload doesn't always work on Linux

Challenger: I've created a React app using the create-react-app boilerplate, which seems to be popular, hot reload sometimes updates when any file changes, sometimes it doesn't, seems to have a minimum duration or something like that ,m using Ubuntu, node vers

Sass doesn't work in create-react-app

Missouri Sass fails to compile in create-react-app. The current package.json structure is { "name": "create-app", "version": "0.1.0", "private": true, "dependencies": { "react": "^16.3.1", "react-dom": "^16.3.1", "react-scripts": "1.1.4"

Sass doesn't work in create-react-app

Missouri Sass fails to compile in create-react-app. The current package.json structure is { "name": "create-app", "version": "0.1.0", "private": true, "dependencies": { "react": "^16.3.1", "react-dom": "^16.3.1", "react-scripts": "1.1.4"

npx create react-app command doesn't work

Yaru When I run create react-app in terminal it shows some errors. npx create react-app example Error: EPERM: operation not permitted, mkdir 'C:\Users\Yasiru' TypeError: Cannot read property 'loaded' of undefined at exit (C:\Program Files\nodejs\node_modul

Create React app - access "on your network" doesn't work

Tomasz Mularczyk I am using create-react-app project. I try to test my localhost:3000 app on iPhone. When I start an application, yarn startI get the following message: Compilation succeeded! You can now view the front-end client in your browser. local: http:/

Optional-Chaining doesn't work in create-react-app

Dimitri Copriva In one create-react-appproject I @babel/plugin-proposal-optional-chaininguse in my `.babelrc However, I have this error:Module parse failed: Unexpected token (22:16) You may need an appropriate loader to handle this file type. Here are all my b

Absolute path doesn't work in create-react-app

abe_of_spades According to this documentation, I created a jsconfig.json file in the root directory to be able to import components using absolute paths in my React app (set up with create-react-app). Unfortunately this doesn't work. I tried installing react-a