Closed pzapo closed 4 years ago
Type property was wrong ...
type={PointSelector.type}
<Annotation
src={img}
alt="Two pebbles anthropomorphized holding hands"
annotations={this.state.annotations}
type={PointSelector.type}
value={this.state.annotation}
onChange={this.onChange}
onSubmit={this.onSubmit}
allowTouch
/>
I have changed line of code that you have pointed out and nothing have changed. Still it goes same error "Uncaught TypeError: Cannot read property 'map' of undefined"
Even if you remove type prop completelty and use default value, it still crashes.
I'm not sure about <Root>
component ...
Please see a working sample: https://codesandbox.io/s/test-react-image-annotation-5bq92
Yes, removed the Root element was the issue. This component should be removed from samples.
OTOH, changing selector type always results in rectangle shape selector. What is the diffrence of changing selector is all works the same? Is there a way to remove exisiting annotation or you have to program it yourself?
Ops ... sorry my bad (the property is TYPE with uppercase)
type={PointSelector.TYPE}
I update the sample with tool selector ... https://codesandbox.io/s/test-react-image-annotation-5bq92
Can I get the working code for functional component , cause I'm unable to convert it
Can we do an edit ,remove annotations apart from just submitting. I was working with props but I coudnt find a solution
Trying to use shared demo code results in:
Warning: Failed prop type: The prop
annotations
is marked as required inAnnotation
, but its value isundefined
.which results in: Uncaught TypeError: Cannot read property 'map' of undefined
Below is sample code that i tried to use.