Don't recreate the persistant calendar component on each render.

master
Tom Hacohen 7 years ago
parent 331d85d3a2
commit 4613a65365

@ -16,6 +16,8 @@ function objValues(obj: any) {
return Object.keys(obj).map((x) => obj[x]);
}
const PersistCalendar = historyPersistor('Calendar')(Calendar);
class JournalCalendar extends React.PureComponent {
props: {
journal: EteSync.Journal,
@ -36,7 +38,6 @@ class JournalCalendar extends React.PureComponent {
}
render() {
const PersistCalendar = historyPersistor('Calendar')(Calendar);
let items = this.props.entries;
return (

@ -19,6 +19,8 @@ import { historyPersistor } from '../persist-state-history';
const addressBookTitle = 'Address Book';
const calendarTitle = 'Calendar';
const PersistCalendar = historyPersistor('Calendar')(Calendar);
class PimMain extends React.PureComponent {
props: {
contacts: Array<ContactType>,
@ -77,8 +79,6 @@ class PimMain extends React.PureComponent {
} as any,
};
const PersistCalendar = historyPersistor('Calendar')(Calendar);
return (
<React.Fragment>
<Tabs

Loading…
Cancel
Save