News Articles react-bootstrap

How can I create different styled image galleries for mobile or desktop?

I am trying to create a quite simple website using React, and then using Bootstrap for the styling. I have an array of data that contains the images I would like to display. I want to be able to map through this array and on desktop show the images in a 2×2 grid, where you […]

How to add entries to dropdown during runtime?

I am attempting to create a dropdown that displays the name of the currently selected item, where the amount of items are pulled from a json file that is stored locally. I found this post: link, however this is in reference to the form component, and it also seems to be outdated in reference to […]

React-boostrap Popover not stay with button on scroll container

I recreated popover in the codesandbox here, follow the documentation code, the popover show up, but after scroll, the pointer does not align with the button anymore, I tried to pass container prop, but still not working. How can I solve this? Thank you. To Reproduce Steps to reproduce the behavior: Click the button Popover […]

CardGroup strap react overflow screen

I have an issue that the CardGroup Component overflow the size, so I need to make it in 2 rows import Item from ‘./Item’; import { CardGroup } from ‘reactstrap’; import "../App.css"; const ItemList = ({products}) => { return ( <CardGroup className="modals" style={{ width:’150rem’, }}> { products.map(prod => <Item prod={prod} key={prod.id} />) } </CardGroup> ) […]

react-bootstrap module has no exported members

I want to use the npm module react-bootstrap (https://www.npmjs.com/package/@types/react-bootstrap) in my Layout component (as the ASP.NET Core 2.1 template client project also has). But the file extension in the template is .js. I’d like to use Typescript, so Layout.tsx looks like this: import * as React from ‘react’; import { Col, Grid, Row } from […]

Passing an event handler through props makes it unusable for some reason

Here’s the code: Typescript Playground I expected the buttons from GameToggleButton to be clickable – then I added console.log() to the handleAnswerChange and I realised that the function isn’t called for some reason. Why is this happening? Before I separated the button into another component, everything was working fine. Source: React – Stack Overflow

React.js With 3 NPM Packages

I wanted To Ask that is there a problem to use react.js with Chakra UI and React Bootstrap and is it effect the performance of the site. The Project Is Big (about 40 page) and I want to get the advantages of the two library together. Source: React – Stack Overflow

Why reactstrap carousel code snippet on document is not working?

I have tried to reactstrap carousel. I copied some codes below it, and tried to use it in my codebase. Carousel tag begin with UncontrolledCarousel working well. But I dont know why this code throw this error. TypeError: carouselItems.map is not a function <Carousel activeIndex={0} next={function noRefCheck(){}} previous={function noRefCheck(){}} slide={false} > <CarouselIndicators activeIndex={0} items={[ { […]

How to change React-Bootstrap NavDropdown menu background color?

I am using react-bootstrap in my application and I needed to change the background color of the menu of NavDropdown component. I used modular css for my react application. I’ve tried background-color but no effect. React-Bootstrap NavDropdown Image index.js: <NavDropdown title={style.dropdownTitle} id={style.dropdownMenu} align="end" > <NavDropdown.Item href="#action/3.1" className={style.dropdownItem} > Profile </NavDropdown.Item> <NavDropdown.Item href="#action/3.1" className={style.dropdownItem} > Learnings […]

Problem in navigation bar using react-bootstrap

I am buidling navbar using react-bootstrap i have kept the code below. I was unable to get the toggle button. when i refer to the documentation i didn’t get any results import React from "react"; import { Nav, Navbar, Container } from "react-bootstrap"; import Logo from "/src/images/logo.png"; import "./Home.css"; export const Home = () => […]

Why are my react-router Links not working when put inside a Bootstrap 5 dropdown navbar button?

I literally copy-pasted the navbar from the Bootstrap page and changed "class" for "className" in each case because I’m working in React. Then I just put the <Link> inside the <a> item, but even if I replace the <a> with the <Link> it doesn’t work in any of both cases. I have also tried replacing […]

How to convert this bootstrap to react bootstrap

I am having a website which was created using bootstrap. now i am migrating my project to react. So, I was trying to use react-bootstrap. can someone help me to translate this Nav bar code written in bootstrap to react-bootstrap. I have tried changing class to className but it didnt work. <nav class="navbar navbar-expand-lg navbar-dark […]

How to convert this bootstrap to react bootstrap

I am having a website which was created using bootstrap. now i am migrating my project to react. So, I was trying to use react-bootstrap. can someone help me to translate this Nav bar code written in bootstrap to react-bootstrap. I have tried changing class to className but it didnt work. <nav class="navbar navbar-expand-lg navbar-dark […]

Infinity loop for React Bootstrap components

I installed react bootstrap 5.1.3 and the app functions normally, but when I copy and paste this component, the app enters an infinite loop. The terminal application runs fine, but the browser displays no errors. There are no additional components in my application. React Version: 17.0.2 => Navigation.js import React from “react”; import { Container, […]

How to use react bootstrap theme in other css files

I am trying to figure out how to use theme colors from my custom react-bootstrap theme in my other CSS files. I specifically am trying to change the color of my header text to be the primary color I have defined in my bootstrap theme. In the past I have used material-ui with react where […]

How to import useAccordionButton on react-bootstrap?

I’m getting this error trying to import useAccordionButton: srcComponentsMoodAccordionsMood.js Line 14:18: ‘decoratedOnClick’ is not defined no-undef Search for the keywords to learn more about each error.< I’m using the version 6.14.14. Source: React – Stack Overflow

I cannot find the error TypeError: Cannot read properties of undefined (reading ‘name’)

Im new to react and I need some help when I´m trying to bring some "products" from an array of objects that I have in one file of my my react app called "products.js". the thing is that I am being able to draw the products within the array in the Home Screen. However when […]

How to stop screen scrolling when page navigation links are clicked, React-Bootstrap and Gatsby

What’s happening is if I scroll down to the bottom of the home page, click "Rental" in the nav, then click the logo in the nav to go back to the home page, the home page scrolls down to the bottom of the page rather than staying at the top (what would be expected). This […]

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.