Skip to content

Commit

Permalink
[B] Deep compare annotation arrays when updating annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
1aurend authored and zdavis committed Aug 20, 2024
1 parent 89c01a5 commit 67fde66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/reader/containers/annotation/Annotatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class Annotatable extends Component {
}

componentDidUpdate(prevProps, prevState) {
if (this.props.annotations?.length !== prevProps.annotations?.length)
if (!isEqual(this.props.annotations, prevProps.annotations))
this.setState({ renderedAnnotations: this.props.annotations });

const { selection } = this.state.selectionState ?? {};
Expand Down

0 comments on commit 67fde66

Please sign in to comment.