Secretmapper / react-image-annotation

An infinitely customizable image annotation library built on React
https://secretmapper.github.io/react-image-annotation/
MIT License
326 stars 135 forks source link

Adds a prop for input text area #51

Closed utkarsh867 closed 1 year ago

utkarsh867 commented 4 years ago

Use Case

I wanted to annotate data, but I wanted a dropdown instead of a text area.

I observed that it was not possible to change the text area without implementing the complete TextEditor component.

This change now allows me to provide a React Component as a prop.

<Annotation
  src={img}
  annotations={annotations}
  value={annotation}
  onChange={setCurrentAnnotation}
  onSubmit={onSubmit}
  renderInputArea={props => <LabelInputArea {...props} />}
/>

I have not written any tests yet.

utkarsh867 commented 4 years ago

@Secretmapper Your feedback will be much appreciated.