简体   繁体   中英

React Js : How to hide/show individually in dynamic list cards

[enter image description here][1]

Hello world !! i am trying to show/hide options on card which is dynamically rendered data from backend/database but when i click single card's option all cards options gets show/hide please help me to make this as: when i click card one's options. . . only card one's options should be show/hide

const [optionToggle, setOptionToggle] = useState(1);

  setOptionToggle(!optionToggle);
};```

```   {optionToggle ? (<>Show</>) : (<>Hide</>)  ```
```  <button id={ride.PK_RIDEREQDID} onClick={() => handleOptionToggle(ride.PK_RIDEREQDID)}
                            >```


[1]: https://i.stack.imgur.com/mEZTV.png

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM