I have a button component that only shows when required (it is for page down and therefore does not show on the first page).
I have done that with this code:
<button
id="hidemeonmain"
onClick={this.pageDown}
className={this.state.count <2
? 'hidden'
: 'clean' }
>
<FontAwesomeIcon
icon="angle-left"
size="2x"
/>
</button>
However I want to hide this button when on a @media query for max-width 736pxFOR ALL VALUES OF STATE.
I am doing this by giving it an id and hiding this in the css. However when the state gets updated it re-shows the button even with an !importantin the @media display:none style.
I thought that the id and important would have precedence over the general class.
Any ideas how to resolve this please?
TIA
EDIT: I have amended this with the correct button!! and included the #id css.
#hidemeonmain {
display: none !important;
I think what is happening is that when the other button (increment) is pressed this increases state and therefore effects the change in class from the ternary which is overriding the #id with the display: hidden !important;