use react hooks to make a component that will convert between different temperature units
user
sure, here is a react component that will convert between different temperature units:

```jsx
import react, { usestate, useeffect } from 'react';

const temperatureconverter = () => {
  const [temperature, settemperature] = usestate(20);
  const [unit, setunit] = usestate('c');

  const converttemperature = (temperature, unit) => {
    switch (unit) {
      case 'c':
        return temperature * 9/5 + 32;
      case 'f':
        return (temperature - 32) * 5/9;
      default:
        throw new error('invalid unit');
    }
  };

  useeffect(() => {
    const handlechange = (event) => {
      settemperature(event.target.value);
    };

    const handleunitchange = (event) => {
      setunit(event.target.value);
    };

    document.getelementbyid('temperature').addeventlistener('change', handlechange);
    document.getelementbyid('unit').addeventlistener('change', handleunitchange);
  }, []);

  return (
    <div>
      <h1>temperature converter</h1>
      <p>enter the temperature in degrees celsius or fahrenheit:</p>
      <input
        id="temperature"
        type="number"
        value={temperature}
        onchange={handlechange}
      />
      <select
        id="unit"
        value={unit}
        onchange={handleunitchange}>
        <option value="c">celsius</option>
        <option value="f">fahrenheit</option>
      </select>
      <p>the temperature in {unit} is: {converttemperature(temperature, unit)}</p>
    </div>
  );
};

export default temperatureconverter;
```
assistant
Sure, here is a React component that will convert between different temperature units:

```jsx
import React, { useState, useEffect } from 'react';

const TemperatureConverter = () => {
  const [temperature, setTemperature] = useState(20);
  const [unit, setUnit] = useState('C');

  const convertTemperature = (temperature, unit) => {
    switch (unit) {
      case 'C':
        return temperature * 9/5 + 32;
      case 'F':
        return (temperature - 32) * 5/9;
      default:
        throw new Error('Invalid unit');
    }
  };

  useEffect(() => {
    const handleChange = (event) => {
      setTemperature(event.target.value);
    };

    const handleUnitChange = (event) => {
      setUnit(event.target.value);
    };

    document.getElementById('temperature').addEventListener('change', handleChange);
    document.getElementById('unit').addEventListener('change', handleUnitChange);
  }, []);

  return (
    <div>
      <h1>Temperature Converter</h1>
      <p>Enter the temperature in degrees Celsius or Fahrenheit:</p>
      <input
        id="temperature"
        type="number"
        value={temperature}
        onChange={handleChange}
      />
      <select
        id="unit"
        value={unit}
        onChange={handleUnitChange}>
        <option value="C">Celsius</option>
        <option value="F">Fahrenheit</option>
      </select>
      <p>The temperature in {unit} is: {convertTemperature(temperature, unit)}</p>
    </div>
  );
};

export default TemperatureConverter;
```
assistant