# All files / components/Anchor/styles DomSafeLink.js

0% Statements 0/14
0% Branches 0/4
0% Functions 0/2
0% Lines 0/4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

     import React from 'react';
    import { Link } from 'react-router-dom';

    /**
     * Prevents the `newTab` or `appearFocused` prop from being passed to Link,
     * which emits errors when it receives props it doesn't expect.
     */
    const DomSafeLink = ({ newTab, appearFocused, children, ...rest }) => (
      <Link {...rest}>{children}</Link>
    );

    export default DomSafeLink;