--- a/client/src/components/NotesList.js Tue Oct 09 19:07:47 2018 +0200
+++ b/client/src/components/NotesList.js Mon Oct 08 18:35:47 2018 +0200
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
-import Immutable from 'immutable';
import Modal from 'react-modal';
import Note from './Note';
import './NoteList.css';
@@ -16,8 +15,8 @@
}
componentDidUpdate(prevProps) {
- if ((this.props.notes || []).size > (prevProps.notes || []).size) {
- this.node.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"})
+ if ((this.props.notes || []).length > (prevProps.notes || []).length) {
+ this.node.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"})
}
}
@@ -115,7 +114,7 @@
};
NotesList.propTypes = {
- notes: PropTypes.instanceOf(Immutable.List).isRequired
+ notes: PropTypes.array.isRequired
};
export default NotesList;