0
0

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 3 years have passed since last update.

React初学者がReactとは何か調べてみた。

0
Last updated at Posted at 2021-04-06

Reactについて

ReactはFacebook社が開発しているJavaScriptのライブラリらしい。

メリット

  • コンポーネントベース

    • UIコンポーネントを使いまわせる。(同じコードを何回も書かなくて済む)
  • Virtual DOM

    • 適切なコンポーネントだけを効率的に更新してレンダリングすることがでる。
  • JSX

  • jsxファイルにすることでHTMLと似た記載ができる。
     

⏬ こんな感じで

/*reactを使うよという宣言*/
import React from 'react';

const sample = () => {
  return <h1>よしあきだよ</h1>;
};

export default sample;

ついでにNext.jsについても書こうかな。そんな知らんけど笑

Next.jsの便利なところ

Pre Rendering

  • Server-Side Rendering
  • Static Generation

ルーティングなどのサポート

Pre Rendering

  • Server-Side Rendering

    • ユーザーがアクセスした時、サーバ側でHTMLをレンダリングする
  • Static Generation (Next.jsさんが推奨してるらしい)

    • ビルドしたタイミングでHTMLをレンダリングしているからすでにHTMLが準備されている状態

ルーティングなどのサポートしてるらしい

 Reactだとreact-routerとかメタタグを付与するreact-helmentなどのライブラリの追加や設定を追加しないといけないらしいがNext.jsだとそれが標準で装備されているらしい。

以上!初学者がReactを軽くまとめた記事でした。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?