Skip to content
Merged
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: 2 additions & 1 deletion src/pages/iou/MoneyRequestDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ const propTypes = {
}).isRequired,

/** The current tab we have navigated to in the request modal. String that corresponds to the request type. */
selectedTab: PropTypes.oneOf([CONST.TAB.DISTANCE, CONST.TAB.MANUAL, CONST.TAB.SCAN]).isRequired,
selectedTab: PropTypes.oneOf(['', CONST.TAB.DISTANCE, CONST.TAB.MANUAL, CONST.TAB.SCAN]),
};

const defaultProps = {
iou: iouDefaultProps,
selectedTab: '',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@akinwale Do we even need an Empty string? We can just set the default value as null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@abdulrahuman5196 I assumed since we're using PropTypes.oneOf for the type, it had to be a literal value. I guess we can just change the type to PropTypes.string?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assumed since we're using PropTypes.oneOf for the type, it had to be a literal value

I don't have a strong preference here, I did check our code base and we seem to have set null alone as default value with removing isRequired and also the way this PR is provided.
I think it would make a difference after TS migration but not ATM in this file I suppose.

So I will review with the current change itself.

};

function MoneyRequestDescriptionPage({iou, route, selectedTab}) {
Expand Down