ReactJs - Reactstrap | Issue with Jumbotron displaying background color

I am trying to create a gray background using Jumbotron in reactstrap.

After installation and reference in required places -

index.js
import 'bootstrap/dist/css/bootstrap.css';
    

Jumbotron has been implemented in SignIn.js -

import React from 'react'
    import Amazon_logo from '../../assets/Amazon_logo.png'
    import { Jumbotron, Container  } from 'reactstrap';
    function SignIn() {
        return (
            <>
            <div>
                <img src={Amazon_logo} style={{width:"10%",margin:"1% 2% 2%"}} ></img>
            </div>
            <div style={{fontSize:'200%',fontWeight:'bold',margin:'1% 2% 2%'}} >
                SignIn To Shopbot/East Dane using your Amazon account
            </div>
            <Jumbotron >
               <Container >
               <span>Login</span> 
               <span> <input type="text" ></input> </span>
               </Container>
            </Jumbotron>
            </>
        )
    }
    
    export default SignIn
    

However, the gray portion is not appearing as expected based on the reactstrap documentation -

https://i.sstatic.net/IX9Ca.png

Instead of the expected appearance, this is what is displayed on the screen -

https://i.sstatic.net/FQmcB.png

EDIT 1 :

"dependencies": {
        "@testing-library/jest-dom": "^5.14.1",
        "@testing-library/react": "^11.2.7",
        "@testing-library/user-event": "^12.8.3",
        "bootstrap": "^4.6.0",
        "react": "^17.0.2",
        "react-dom": "^17.0.2",
        "react-scripts": "4.0.3",
        "reactstrap": "^8.9.0",
        "web-vitals": "^1.1.2"
      }
    

Answer №1

It seems like the issue arises from using Bootstrap 5 alongside Reactstrap. According to the Reactstrap documentation, the components are tailored for Bootstrap 4, Refer to: About the Project - Section. There's also a discussion in their repository regarding the upcoming upgrade plan for Bootstrap 5. View here.

To prevent any compatibility issues, I would suggest sticking to the same version specified in the documentation. For instance, using the latest 4.x version, which is currently 4.6:

  "dependencies": {
    "bootstrap": "4.6.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "reactstrap": "8.9.0"
  }

Additionally, note that the Jumbotron component has been removed in Bootstrap 5 as it can now be recreated using utilities, Check out the details. You can refer to an official example from Bootstrap on creating the equivalent Jumbotron component using custom utilities. See example.

Below is an illustration showcasing both Bootstrap 4 and Bootstrap 5:

Provided code snippet...

An alternative solution involves reintegrating the styles of the .jumbotron class from Bootstrap 4 into your project's stylesheet like this:

.jumbotron {
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  background-color: #e9ecef;
  border-radius: 0.3rem;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The result from the AngularJs promise is coming back as undefined

I am facing an issue while trying to implement the login function of my AuthService factory in conjunction with my AuthLoginController controller. The problem arises when the User.login function is triggered with incorrect email and password details, causi ...

Retrieve a document utilizing XHR on iOS Safari platform

I'm currently working on adding the capability to download a file stored on a server. To access the file, I need to include the Authorization header, requiring me to send an XHR request to retrieve the file from the server. Since the file content is s ...

How to Personalize ToolTips in Material UI SpeedDial

I am utilizing the Speed Dial Material UI Component and I am looking to customize the style of the tooltips import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import Button from '@material-ui/core/B ...

Using the Google Picker API to dynamically load a file picker when needed

I am interested in integrating the Google Picker API. The provided example demonstrates the picker being loaded upon page load, but I would like the picker to load when a specific action is taken, such as clicking on a button. However, implementing this be ...

Issue with ng-disabled not functioning properly for href tag within list item

Is there a way to prevent clicking on the <a> tag within a list item in a UI list so that the associated <div> is not displayed when clicked (excluding the last list item)? I have attempted using ng-disabled directly on the list item attribute ...

What steps can I take to stop Material UI Dialog from closing when clicking the backdrop?

I am facing a challenge with my React JS app that utilizes the Dialog component. I am struggling to figure out how to prevent the dialog from closing when clicking on the backdrop, as I have a specific action within the dialog that should control its dismi ...

I'm encountering CORS issues while attempting to log in using guacamole from my React app. Can anyone advise on what might be causing this problem

Having trouble logging into the Guacamole form through a React JS web application. The Guacamole server is hosted on Tomcat server, while the React app is on Node.js; both operating on separate domains. Despite using Nginx proxy on the server, encounteri ...

Setting a relative path for a reverse proxy in a Next.js server: a step-by-step guide

I currently have two servers, A and B, both hosted on AWS. Server A has a rule in place that directs traffic with paths containing /v2/ to server B, which is functioning correctly. Server B runs a NextJs application using nginx and express. All routes on ...

What is the best way to organize an array both alphabetically and by the length of its elements?

Imagine I am working with an array like this: ['a', 'c', 'bb', 'aaa', 'bbb', 'aa']. My goal is to sort it in the following order: aaa, aa, a, bbb, bb, c. this.array= this.array.sort((n1, n2) => ...

Preserving the information from a webpage by utilizing casperjs for scraping and saving table data

What is the most efficient way to preserve table data collected during a web scraping process with casperjs? Saving it as a file after serializing into a json object. Sending an ajax request to php and then storing it in a mysql database. ...

Having difficulty in animating the upward movement of textbox2

I've got a form that contains 2 buttons and 2 textareas. When the form loads, I want to display only section1 (button, textarea) and the section2 button. Upon clicking the section2 button, my aim is to hide the section1 textarea, reveal the section2 t ...

Is there a way to access the filtered or organized rows in the Quasar Q-Table?

I have encountered a roadblock in my project. Despite installing Quasar version 2.0.0, I realized that it lacks a property to access the filtered or sorted rows. Previous versions of q-table had a computedRows property which was missing in the latest ver ...

The Map/Reduce function is producing incorrect results because of null values, causing me to receive NaN or erroneous

I am ready to delve into another Map/Reduce query. Within my database, I have a collection named "example" which is structured like this: { "userid" : "somehash", "channel" : "Channel 1" } The Map/Reduce functions I am using are as follows: var map = f ...

React code displaying misalignment between label and input

Can you help me align my URL and https:// on the same margin? https://i.sstatic.net/hxkkC.png <div className="card"> <div className="card-body"> <div className="form-group col-12"> <label cla ...

Adjusting the dimensions of the box while the clock is ticking

I am looking to automatically resize a cube whenever a new value is entered in the input text box. I have found a similar solution that updates the cube size only when a button is clicked. http://jsfiddle.net/EtSf3/3/ document.getElementById('btn&ap ...

Turn off the nicescroll scroll bar that appears as a default feature

Is there a way to disable the nicescroll scroll bar that appears in red by default on my html page? It's causing issues with zooming in and breaking the layout. ...

Implementing Express.js allows for the seamless casting of interfaces by the body within the request

I have created a similar structure to ASP.NET MVC and uploaded it on my github repository (express-mvc). Everything seems fine, but I am facing an issue with casting the body inside the request object to match any interface. This is what I am aiming for: ...

"Can you please provide guidance on accessing the current value of Ref in react-native

I have exhausted all options provided in this URL: How to extract values from input types using this.refs in reactjs? From ref.current.value to ref.value to ref._getText(), everything returns as undefined. After inspecting the JSON output of the ref objec ...

utilizing jQuery to create dynamic data changes based on JSON file

<div id="rightside"> <h1>John Doe</h1> <p>1980 - 2020 <p><a href="johnswebsite.com">Visit Website</a> <p>Lorem ipsum dolor sit amet, consectetur adi ...

Guidelines for delivering resources from S3 to Client within a node.js program

I am looking to optimize the way my static files (such as images and fonts) are served to clients by utilizing Amazon S3 instead of storing them directly on the web host. After creating a bucket and uploading my files, I found myself confused when trying t ...