Skip to content

Commit

Permalink
Merge pull request #19292 from bernhardoj/fix/19181-console-error
Browse files Browse the repository at this point in the history
Update ref prop types
  • Loading branch information
Julesssss authored May 22, 2023
2 parents 0ec61bf + a4f0306 commit f321c89
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/components/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ const propTypes = {
accessibilityLabel: PropTypes.string,

/** A ref to forward the button */
forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.oneOfType([PropTypes.instanceOf(React.Component), PropTypes.func])})]),
// eslint-disable-next-line react/forbid-prop-types
forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.object})]),
};

const defaultProps = {
Expand Down
3 changes: 2 additions & 1 deletion src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const propTypes = {
navigateToStep: PropTypes.func.isRequired,

/** The policyID of the request */
policyID: PropTypes.string.isRequired,
policyID: PropTypes.string,
};

const defaultProps = {
Expand All @@ -81,6 +81,7 @@ const defaultProps = {
session: {
email: null,
},
policyID: '',
...withCurrentUserPersonalDetailsDefaultProps,
};

Expand Down
3 changes: 2 additions & 1 deletion src/components/SettlementButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const propTypes = {
nvp_lastPaymentMethod: PropTypes.objectOf(PropTypes.string),

/** The policyID of the report we are paying */
policyID: PropTypes.string.isRequired,
policyID: PropTypes.string,

/** Additional styles to add to the component */
style: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]),
Expand All @@ -66,6 +66,7 @@ const defaultProps = {
nvp_lastPaymentMethod: {},
style: [],
iouReport: {},
policyID: '',
};

class SettlementButton extends React.Component {
Expand Down
3 changes: 2 additions & 1 deletion src/components/withNavigationFallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default function (WrappedComponent) {
WithNavigationFallback.contextType = NavigationContext;
WithNavigationFallback.displayName = `WithNavigationFocusWithFallback(${getComponentDisplayName(WrappedComponent)})`;
WithNavigationFallback.propTypes = {
forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.oneOfType([PropTypes.instanceOf(React.Component), PropTypes.func])})]),
// eslint-disable-next-line react/forbid-prop-types
forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.object})]),
};
WithNavigationFallback.defaultProps = {
forwardedRef: undefined,
Expand Down
3 changes: 2 additions & 1 deletion src/components/withNavigationFocus.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default function withNavigationFocus(WrappedComponent) {

WithNavigationFocus.displayName = `withNavigationFocus(${getComponentDisplayName(WrappedComponent)})`;
WithNavigationFocus.propTypes = {
forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.oneOfType([PropTypes.instanceOf(React.Component), PropTypes.func])})]),
// eslint-disable-next-line react/forbid-prop-types
forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.object})]),
};
WithNavigationFocus.defaultProps = {
forwardedRef: undefined,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/iou/steps/MoneyRequestConfirmPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ const propTypes = {
navigateToStep: PropTypes.func.isRequired,

/** The policyID of the request */
policyID: PropTypes.string.isRequired,
policyID: PropTypes.string,
};

const defaultProps = {
iouType: CONST.IOU.MONEY_REQUEST_TYPE.REQUEST,
canModifyParticipants: false,
policyID: '',
};

const MoneyRequestConfirmPage = (props) => (
Expand Down

0 comments on commit f321c89

Please sign in to comment.