When I try to change colour depends on the count it show’s the error TypeError: Cannot read property ‘style’ of null
You can achieve what you wanted this way. return( <div className=’container_new’> <h1>Counter</h1> <span id=’value’ style={{ color: Count === 0 ? ‘black’ : ‘white’ }}>{Count}</span> <div> <button className=”btn decrease” onClick={handleDecrement} >decrease</button> …