openscript/react-dsv-import

View on GitHub
src/components/inputs/TextareaInput.tsx

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%
import React from 'react';
import { useDSVImport } from '../../features/context';

export function TextareaInput() {
  const [, dispatch] = useDSVImport();

  const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
    dispatch({ type: 'setRaw', raw: event.target.value });
  };

  return <textarea onChange={handleChange} />;
}