Writing a ToDoList web application following a tutorial written using the old Lifecycle method of React. I am using Hooks syntax instead, and am stuck converting some line into the new hooks syntax
Environment
Truffle v5.1.56 (core: 5.1.56)
Solidity v0.5.16 (solc-js)
Node v12.19.0
Web3.js v1.2.9
Details
Here is the code for my ToDoList solidity file
Code to reproduce
here is the code am trying to replicate. Need some help converting the circled part

