[Request] Be able to set spring config per value

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
28/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

まず、リンクされた CodeSandbox で値ごとの設定が必要になるケースを再現し、既存の useSpring API の動作を確認します。1 つの spring 内で opacity と x の個別の設定がどのように機能すべきかを定義し、1 つの API でそれぞれの設定を使って両方の値を制御できることを検証します。

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

説明

kind: request

🚀 Feature Proposal

The idea is to be able to set a spring config per value in a single useSpring.

Motivation + Example

I like to use a single useSpring per component where possible and when doing more complex motion design I need individual values to have their own spring config. This especially becomes important when the spring config is modified depending on the state of the app and user interactions. For example, I may have an opacity value that I want to always transition with a linear duration but an x value that toggles from being stiff to wobbly depending on its direction of motion (open or close).

Currently I have to make two springs to handle this case and then use their apis in sync.

Note: I thought I could use a useSpringRef for a single api to control both springs but I couldn't figure out how to change the config for individual springs this way.

Here is a sandbox: https://codesandbox.io/s/dreamy-turing-3kpom?file=/src/App.js

主要言語
TypeScript
スター
29.3k
フォーク
1.2k
平均マージ
3日 15時間
マージ済み PR(30日)
17

環境構築

はじめの一歩

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

pmndrs/react-spring のほかの issue

pmndrs/react-spring の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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