import React, {useState} from 'react'; const enterKey = 13; const TermInput = ({terms, setTerms}) => { const [value, setValue] = useState(''); const handleKeyDown = ev => { if (ev.keyCode === enterKey) { ev.preventDefault(); if (!terms.includes(value)) { setTerms(terms.concat([value])); } setValue(''); } }; const handleChange = ev => { setValue(ev.target.value); }; const handleRemove = removedTerm => { console.log(removedTerm); console.log(terms); setTerms(terms.filter(term => term !== removedTerm)); }; return (