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 機能メモ(自分用)

Last updated at Posted at 2020-10-24

###表示出しわけ

let flg = true;
let el = (
     <div>
      { flg &&
        <p>yesなら表示</p>
      }
     </div>
);

※ flg ? a : b
という表示でも可能

###リストの表示

let list = [
    <li>松井</li>,
    <li>田中</li>
];
let el = (
    <div>
       <ul>
       {list}
       </ul>
    </div>
);

※ list.map((value)) => (処理)でも操作可能

###classの記入

<div className="test">sample</div>

※jsxにはclass="test"では無いらしい

###テキストの入力

<input value={this.state.text} onChange={(e)=>{console.log(e.target.valiue)}}
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?