D
D
DDDblct2020-06-02 16:12:39
React
DDDblct, 2020-06-02 16:12:39

How to create a page with contacts (name, number) in React with the ability to add/remove?

The employer sent a TOR for the frontend developer, to create an application for the contact list on React, in which it should be possible to add / delete / edit contacts, it is also desirable to have a search function. I found a similar solution in JavaScript, but I don’t understand how to transfer it.

<!DOCTYPE html>
<html>
<body>
<button onclick = "myFunc()">Записать</button>
<input type = "text">
<p id = "numbers"></p>
<script>
  var numbers = ["Victor", "John", "Robert"];
  document.getElementById("numbers").innerHTML = numbers;
  var newNumber; //

  function myFunc() {
    newNumber = document.getElementsByTagName( "input" )[0].value;
    numbers.unshift( newNumber );
    document.getElementById("numbers").innerHTML = numbers;
  }
</script>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Makarov, 2020-06-03
@kirbi1996

Google creating a crud application on react, you can even use English-language resources. In general, when I was training, I wrote something similar, but I don’t remember if it’s completely shitty code https://github.com/kirbi96/kirbi96.github.io/tree/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question