score:1

Accepted answer
{e.style.display  = this.state.showOn ? 'block' : 'none'}

score:0

e.style.display = ( this.state.showOn ) ? 'block' : 'none';

score:0

render() {
    return (
        <div>
            <div style={({display: this.state.showOn ? 'block' : 'none'})}> 
                Show Me
            </div>
            <button onClick={toggleFilter}>Toggle Filter</button>
    )
}

score:2

e.style.display = this.state.showOn ? 'block' : 'none';

score:2

e.style.display = this.state.showOn ? 'block' : 'none'}

Related Query

More Query from same tag