Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/Marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export class Marker extends React.Component {

componentDidUpdate(prevProps) {
if ((this.props.map !== prevProps.map) ||
(this.props.position !== prevProps.position) ||
((this.props.position && prevProps.position)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most unreadable, please rather use a function such as 'arePositionsEqual' to simplify readability. thank you

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it's been a long time, I'll see if this change still makes sense, if so, I'll make the change later.
Thanks for the feedback.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem still persists in the current version of the lib.

I solved your issue in the last commits.

? this.props.position.lat !== prevProps.position.lat || this.props.position.lng !== prevProps.position.lng
: this.props.position !== prevProps.position) ||
(this.props.icon !== prevProps.icon)) {
if (this.marker) {
this.marker.setMap(null);
Expand Down