Pass state outside of component scope
@barelyhuman がすでに取り組んでいます。
2021年12月27日 から。
評価
この issue はまだ評価されていません。
説明
It seems that right now there isn't a convenient way to pass mutable state outside of the component or hook, i.e. return it, pass it to a function or pass it to children.
The only way to get the setter is by creating a closure val => myState = val. So if I want to pass around mutable state (read and write) I need to get the setter, then I need to pass both the setter and the value around.
This is a little verbose, and also wherever I pass the mutable state to I'll have to deal with two variables again (value and setter) instead of one.
I think that it could be nice if there was a better way to get the setter and pass around mutable state.
- 主要言語
- TypeScript
- スター
- 7
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
barelyhuman/babel-plugin-mutable-react-state のほかの issue
-
Caveatsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
Test Cases for Base再び着手できるかも @barelyhuman が 1750 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンcore tests
barelyhuman/babel-plugin-mutable-react-state#3 · 担当者 1 名 ·
-
Add transformations for UpdateExpressions再び着手できるかも @barelyhuman が 1750 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンcore
barelyhuman/babel-plugin-mutable-react-state#2 · 担当者 1 名 ·
barelyhuman/babel-plugin-mutable-react-state の issue をすべて見る
似ている issue
-
bug via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pingdotgg/t3code#14452 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
solana-foundation/program-examples#747 · コメント 1 件 ·
メンテナーはふだん 9 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
remotion-dev/remotion#11847 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openwatersio/slackwater#355 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
melgarafael/DeskcommCRM#1998 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信