diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js index 96978acb6964..295c6a6541c8 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js @@ -1,3 +1,4 @@ +import _ from 'underscore'; import React from 'react'; import {Pressable, StyleSheet} from 'react-native'; import lodashGet from 'lodash/get'; @@ -9,14 +10,13 @@ import {CONTEXT_MENU_TYPES} from '../../../pages/home/report/ContextMenu/Context import AttachmentView from '../../AttachmentView'; import fileDownload from '../../../libs/fileDownload'; - /* * This is a default anchor component for regular links. */ const BaseAnchorForCommentsOnly = (props) => { let linkRef; + const rest = _.omit(props, _.keys(propTypes)); return ( - props.isAttachment ? ( { @@ -53,7 +53,7 @@ const BaseAnchorForCommentsOnly = (props) => { target: props.target, }} // eslint-disable-next-line react/jsx-props-no-spreading - {...props} + {...rest} > {props.children} diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js index bc88cef6880e..49a3b581e27b 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js @@ -1,3 +1,4 @@ +import _ from 'underscore'; import React from 'react'; import lodashGet from 'lodash/get'; import {Linking, StyleSheet, Pressable} from 'react-native'; @@ -15,6 +16,7 @@ import styles from '../../../styles/styles'; */ const BaseAnchorForCommentsOnly = (props) => { let linkRef; + const rest = _.omit(props, _.keys(propTypes)); return ( props.isAttachment ? ( @@ -48,8 +50,8 @@ const BaseAnchorForCommentsOnly = (props) => { linkRef = el} style={StyleSheet.flatten(props.style)} - // eslint-disable-next-line react/jsx-props-no-spreading - {...props} + // eslint-disable-next-line react/jsx-props-no-spreading + {...rest} > {props.children}