Changing Data with a Function in React

It is not necessary to perform any operations on the state directly on the output. You can use the function:

jsxfunction square(num) {
  return num ** 2;
}

function App() {
  const [value, setValue] = useState(0);
  
  function handleChange(event) {
    setValue(event.target.value);
  }
  
  return <div>
    <input value={value} onChange={handleChange} />
    <p>{square(value)}</p>
  </div>;
}
Задание 1

Given an input and a paragraph. The user's age is entered into the input. Make it so that when typing, the user's year of birth automatically appears in the paragraph.

Задание 2

Given an input and a paragraph. The input contains degrees Fahrenheit. Make it so that when you type text, the paragraph automatically converts to degrees Celsius.