Skip to content

Commit

Permalink
Merge pull request #22007 from StevenKKC/fixConsoleErrorOnReportScreen
Browse files Browse the repository at this point in the history
fix console error on report screen which has task
  • Loading branch information
Joel Bettner authored Jul 7, 2023
2 parents 24cd379 + 15a96ea commit acee44e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/TextLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ const propTypes = {

/** Callback that is called when mousedown is triggered */
onMouseDown: PropTypes.func,

/** A ref to forward to text */
forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.instanceOf(React.Component)})]),
};

const defaultProps = {
forwardedRef: undefined,
href: undefined,
style: [],
onPress: undefined,
Expand Down Expand Up @@ -66,6 +70,7 @@ function TextLink(props) {
onPress={openLink}
onMouseDown={props.onMouseDown}
onKeyDown={openLinkIfEnterKeyPressed}
ref={props.forwardedRef}
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
Expand All @@ -77,4 +82,10 @@ function TextLink(props) {
TextLink.defaultProps = defaultProps;
TextLink.propTypes = propTypes;
TextLink.displayName = 'TextLink';
export default TextLink;
export default React.forwardRef((props, ref) => (
<TextLink
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
forwardedRef={ref}
/>
));

0 comments on commit acee44e

Please sign in to comment.