Mam dwa problemy jeden to nie mogę nadać productowi css show-text {display:none} ponieważ dostaje bład
TypeError: Cannot read properties of null (reading 'classList')
The above error occurred in the <ProductData> component:
Product
<div className="product">
<div className="product--style">
<h4>Product {Props.Count} </h4>
<button className="product--show" onClick={productRef.current.classList.toggle("show-text")}>
∨
</button>
<button className="product--edit" onClick={edit}>
✎
</button>
<button className="product--delete" onClick={del}>
✘
</button>
<div className="show-text" ref={productRef}>
<p>Capmaing Name {Props.CampaignName}</p>
<p>Keyword {Props.Keywords}</p>
<p>Big amount {Props.BigAmount}</p>
<p>Campaing found {Props.BigAmount - Props.CampaignFound}</p>
<p>ON/OFF {Props.OnOff}</p>
<p>Town {Props.Town}</p>
<p>Radius {Props.Radius}km</p>
</div>
</div>
</div>
style
.show-text {
display: none;
}
cały kod
https://codesandbox.io/s/product-237234