LoginSignup
1
1

More than 3 years have passed since last update.

Reactで外部ドメイン向けにリンクを生成する(ReactRouterだとできない?ので。。)

Posted at

概要

Reactで外部ドメイン向けにリンクを生成する(ReactRouterだとできない?ので。。)

実装

↓で定義したLinkToOtherDomainコンポーネントを使う。

import React from "react";

export const LinkToOtherDomain = props => {

    const { to, children, ...other } = props;
    return (
        <a href={to} {...other} rel="noopener noreferrer">
            {children}
        </a>
    );
};
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1