# React Components 6-Setting Attributes

**URL:** https://forum.codewithmosh.com/t/react-components-6-setting-attributes/15520
**Category:** React
**Created:** [September 29, 2022, 9:07pm UTC](https://forum.codewithmosh.com/t/react-components-6-setting-attributes/15520 "2022-09-29T21:07:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jp2code](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jp2code/32/4681_2.png) [@jp2code](https://forum.codewithmosh.com/u/jp2code)
#### Post date: [September 29, 2022, 9:07pm UTC](https://forum.codewithmosh.com/t/react-components-6-setting-attributes/15520/1 "2022-09-29T21:07:43Z")

</div>

I am trying to get through the Components video in React. My file `counter.jsx` is:

```auto
import React, { Component } from 'react';
import 'bootstrap/dist/css/bootstrap.css';

class Counter extends Component {
    state = {
        count: 0
    };
    styles = {
        fontSize: 30,
        fontWeight: 'bold',
    };
    render() { 
        return (
            <div>
                <span style={this.styles} className='badge badge-primary m-2'>{this.formatCount()}</span>
                <button className='btn btn-secondary btn-sm'>Increment</button>
            </div>
        );
    }

    formatCount() {
        const { count } = this.state;
        return count === 0 ? 'Zero' : count;
    }
}
 
export default Counter;

```

The code is like in the video, but my “Zero” button does not appear. It is still visible in the Element tab.

How do I get my text to show like in the course? It should really cover how to debug issues, because they happen!

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/f/f4b4c76b21516d6d06de827e202b1fee68a32eb6.png)

---

<div class="post-metadata">

### Author: ![UniqueNospaceShort](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/uniquenospaceshort/32/1814_2.png) [@UniqueNospaceShort](https://forum.codewithmosh.com/u/UniqueNospaceShort)
#### Post date: [October 1, 2022, 7:33pm UTC](https://forum.codewithmosh.com/t/react-components-6-setting-attributes/15520/2 "2022-10-01T19:33:08Z")

</div>

Hi, Do you have any message in the console?

---

<div class="post-metadata">

### Author: ![jp2code](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jp2code/32/4681_2.png) [@jp2code](https://forum.codewithmosh.com/u/jp2code)
#### Post date: [October 2, 2022, 6:42am UTC](https://forum.codewithmosh.com/t/react-components-6-setting-attributes/15520/3 "2022-10-02T06:42:18Z")

</div>

No, but I figured it out. The bootstrap I loaded is not the same as the bootstrap that is used in the book (4 years old). In the newer bootstrap, the CSS for the button is not colored like it is in the example course.

---

<div class="post-metadata">

### Author: ![onlyhasbi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/onlyhasbi/32/4608_2.png) [@onlyhasbi](https://forum.codewithmosh.com/u/onlyhasbi)
#### Post date: [October 3, 2022, 6:46am UTC](https://forum.codewithmosh.com/t/react-components-6-setting-attributes/15520/4 "2022-10-03T06:46:50Z")

</div>

```auto
className='badge badge-primary m-2'

```

in the latest bootstrap, I don’t find a badge-primary class but bg-primary

> **[example - CodeSandbox](https://codesandbox.io/s/example-31teeu?file=%2Fsrc%2FApp.js)**
>
> example by onlyhasbi using bootstrap, react, react-dom, react-scripts

see bootstrap doc [Badges · Bootstrap v5.0](https://getbootstrap.com/docs/5.0/components/badge/)

---

<div class="post-metadata">

### Author: ![jp2code](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jp2code/32/4681_2.png) [@jp2code](https://forum.codewithmosh.com/u/jp2code)
#### Post date: [October 3, 2022, 10:45am UTC](https://forum.codewithmosh.com/t/react-components-6-setting-attributes/15520/5 "2022-10-03T10:45:03Z")

</div>

@onlyhasbi - that was a good find! Thanks
