1const input = props => {
2
3let textInput = React.createRef();
4
5function handleClick() {
6 console.log(textInput.current.value);
7}
8
9return (
10 <div>
11 <input ref={textInput} placeholder="Type a message..." />
12 <div onClick={handleClick} className="icon">
13 <i className="fa fa-play" />
14 </div>
15 </div>
16 )
17}