Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions src/components/OnyxProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Onyx.registerLogger(({level, message}) => {
// the same key (e.g. FlatList renderItem components)
const [withNetwork, NetworkProvider] = createOnyxContext(ONYXKEYS.NETWORK);
const [withPersonalDetails, PersonalDetailsProvider] = createOnyxContext(ONYXKEYS.PERSONAL_DETAILS);
const [withCurrentDate, CurrentDateProvider] = createOnyxContext(ONYXKEYS.CURRENT_DATE);
const [
withReportActionsDrafts,
ReportActionsDraftsProvider,
Expand All @@ -55,6 +56,7 @@ const OnyxProvider = props => (
NetworkProvider,
PersonalDetailsProvider,
ReportActionsDraftsProvider,
CurrentDateProvider,
]}
>
{props.children}
Expand All @@ -70,4 +72,5 @@ export {
withNetwork,
withPersonalDetails,
withReportActionsDrafts,
withCurrentDate,
};
9 changes: 2 additions & 7 deletions src/pages/home/report/ReportActionItemDate.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, {memo} from 'react';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import styles from '../../../styles/styles';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import compose from '../../../libs/compose';
import ONYXKEYS from '../../../ONYXKEYS';
import Text from '../../../components/Text';
import {withCurrentDate} from '../../../components/OnyxProvider';

const propTypes = {
/** UTC timestamp for when the action was created */
Expand All @@ -24,10 +23,6 @@ ReportActionItemDate.displayName = 'ReportActionItemDate';

export default compose(
withLocalize,
withOnyx({
currentDate: {
key: ONYXKEYS.CURRENT_DATE,
},
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @marcaaron I've noticed this component does not use the date received from Onyx at all
Is this something we're passing to force a re-render?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm that's a good question. I didn't look into the original intention behind why this subscription was added. Maybe we can look at the git blame to find out more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Original PR is here -> https://github.com/Expensify/App/pull/3573/files

I think the intention is to force a re-render.

withCurrentDate(),
memo,
)(ReportActionItemDate);