New array methods

オープン
#6,170 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, react
領域
documentation

調査の方向性

Updating Arrays in State ページから始め、リンクされている配列メソッドのリファレンスを確認して、toSpliced()、with()、toSorted()、toReversed() を既存のスプレッド演算子の例と比較します。これらのメソッドがより明確なガイダンスを提供するかどうかを判断し、提供する場合はページを更新すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Now that all browsers support the new array methods toSpliced(), with(), toSorted(), toReversed(), do they offer a better solution compared to the spread operator, worth documenting in the Updating Arrays in State page?

In the current docs:

const insertAt = 1; // Could be any index
    const nextArtists = [
      // Items before the insertion point:
      ...artists.slice(0, insertAt),
      // New item:
      { id: nextId++, name: name },
      // Items after the insertion point:
      ...artists.slice(insertAt)
    ];

Could be replaced with:

 setArtists(artists.toSpliced(1, 0, { id: nextId++, name: name }));
主要言語
JavaScript
スター
11.8k
フォーク
7.9k
平均マージ
16時間 6分
マージ済み PR(30日)
7

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

reactjs/react.dev のほかの issue

reactjs/react.dev の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。