Skip to content

Commit be757dc

Browse files
committed
Fix BaseAnchorForCommentsOnly
1 parent a9c2221 commit be757dc

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import _ from 'underscore';
12
import React from 'react';
23
import {Pressable, StyleSheet} from 'react-native';
34
import lodashGet from 'lodash/get';
@@ -9,14 +10,13 @@ import {CONTEXT_MENU_TYPES} from '../../../pages/home/report/ContextMenu/Context
910
import AttachmentView from '../../AttachmentView';
1011
import fileDownload from '../../../libs/fileDownload';
1112

12-
1313
/*
1414
* This is a default anchor component for regular links.
1515
*/
1616
const BaseAnchorForCommentsOnly = (props) => {
1717
let linkRef;
18+
const rest = _.omit(props, _.keys(propTypes));
1819
return (
19-
2020
props.isAttachment
2121
? (
2222
<Pressable onPress={() => {
@@ -53,7 +53,7 @@ const BaseAnchorForCommentsOnly = (props) => {
5353
target: props.target,
5454
}}
5555
// eslint-disable-next-line react/jsx-props-no-spreading
56-
{...props}
56+
{...rest}
5757
>
5858
{props.children}
5959
</Text>

src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import _ from 'underscore';
12
import React from 'react';
23
import lodashGet from 'lodash/get';
34
import {Linking, StyleSheet, Pressable} from 'react-native';
@@ -15,6 +16,7 @@ import styles from '../../../styles/styles';
1516
*/
1617
const BaseAnchorForCommentsOnly = (props) => {
1718
let linkRef;
19+
const rest = _.omit(props, _.keys(propTypes));
1820
return (
1921
props.isAttachment
2022
? (
@@ -48,8 +50,8 @@ const BaseAnchorForCommentsOnly = (props) => {
4850
<Text
4951
ref={el => linkRef = el}
5052
style={StyleSheet.flatten(props.style)}
51-
// eslint-disable-next-line react/jsx-props-no-spreading
52-
{...props}
53+
// eslint-disable-next-line react/jsx-props-no-spreading
54+
{...rest}
5355
>
5456
{props.children}
5557
</Text>

0 commit comments

Comments
 (0)