Skip to content

Commit

Permalink
use detructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
hungvu193 committed Oct 1, 2023
1 parent fb04cc9 commit 38dd253
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pages/settings/Security/TwoFactorAuth/Steps/VerifyStep.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable rulesdir/onyx-props-must-have-default */
import React, {useEffect} from 'react';
import {withOnyx} from 'react-native-onyx';
import {ScrollView, View} from 'react-native';
Expand All @@ -23,14 +24,13 @@ import {defaultAccount, TwoFactorAuthPropTypes} from '../TwoFactorAuthPropTypes'

const TROUBLESHOOTING_LINK = 'https://community.expensify.com/discussion/7736/faq-troubleshooting-two-factor-authentication-issues/p1?new=1';

const defaultProps = {
account: defaultAccount,
const defaultSession = {
session: {
email: null,
},
};

function VerifyStep({account, session}) {
function VerifyStep({account = defaultAccount, session = defaultSession}) {
const {translate} = useLocalize();

const formRef = React.useRef(null);
Expand Down Expand Up @@ -146,9 +146,7 @@ VerifyStep.propTypes = {
email: PropTypes.string.isRequired,
}),
};
VerifyStep.defaultProps = defaultProps;

// eslint-disable-next-line rulesdir/onyx-props-must-have-default
export default withOnyx({
account: {key: ONYXKEYS.ACCOUNT},
session: {key: ONYXKEYS.SESSION},
Expand Down

0 comments on commit 38dd253

Please sign in to comment.