LoginSignup
1
0

More than 1 year has passed since last update.

React で指定した数コンポーネントを繰り返したいとき

Posted at

Reactで指定した数繰り返したいとき

とりあえずお手軽に書きたいときに

// 100回繰り返される
{[...Array(100)].map(() => <HogeComponent />)}

配列オブジェクトをスプレッド構文...で展開しmapでJSXで埋めている感じです

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