I am trying to get through the Components video in React. My file counter.jsx
is:
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!