B
B
BaronSmile2021-05-06 21:24:19
React
BaronSmile, 2021-05-06 21:24:19

How to make a certain input appear and disappear when a check is made?

Please help with the check and input logic, when we check a certain checkbox a certain input should react (i.e. appear and disappear). How to implement it? CODE

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-05-06
@BaronSmile

You have an array of selected values ​​- based on it, create inputs:

<div className={css.inputList}>
  {checkedList.map(n => (
    <div className={css.field} key={n}>
      <p>{n}:</p>
      <Input />
    </div>
  ))}
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question