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

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

Loading…
Cancel
Save