8
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

<Helmet>ってなんぞや!react-helmet

Last updated at Posted at 2019-11-02

#react-helmetってなに

headタグを使用する為に用いるReactのコンポーネントです
こんな感じで使ってあげて!

##使いかた

  • react-helmetをyarn add してinstallしよう
yarn add react-helmet
yarn install
  • はい、インポート
import { Helmet } from 'react-helmet';
  • あとは使うだけ
return(
  <>
    <Helmet title={message.title} />
    <Wrapper>
      <Title>....</Title>
    </Wrapper>
  </>
);

##metaタグってなに
webページの情報を検索エンジンやブラウザに伝えるタグのこと。
HTMLのheadタグ内に書くものやで

<meta name=“description”>
<meta name=“keywords”>

などをreactで使用しているのと同じ感覚で使用する

便利やなああ

参考
https://www.genius-web.co.jp/blog/website-operation/what-is-the-meta-tag-for-beginners.html

8
2
1

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
8
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?