React for Beginners - chosen list element is not highlighted

I’m on first lessons. It is blocking me because, for unknown reason it is not looking same as in tutorial. I’m writing same code with Mosh Recording and have different effects. I I’m on lesson “Building Components” → 7 Managing State
and when I’m choosing one element from list instead of highlighting on blue it is aligns to right.

it would be better if you share your react code here.

  1. clear all css given to you by react
  2. see if you imported bootstrap correctly
  3. use inspector to inspect the individual elements that aligns right and check which css code are making it do that

All css files are empty on this step of course

import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "bootstrap/dist/css/bootstrap.css";

    <App />

import ListGroup from "./components/ListGroup";

function App() {
  return (
      <ListGroup />

export default App;
import { useState } from "react";
// import "./ListGroup.css";

function ListGroup() {
    let items = ["New York", "San Francisco", "Tokyo", "London", "Paris"];
    const [selectedIndex, setselectedIndex] = useState(-1);
    return (
            {items.length === 0 && <p>No item found</p>}
            <ul className="list-group">
                {, index) => (
                            selectedIndex === index
                                ? "listg-group-item active"
                                : "list-group-item"
                        onClick={() => {

export default ListGroup;

Hi I can see you have a typo on your first className in your li

Królu złoty dziękuję!:wink: Thank you very much lucidlear :slight_smile: