acl-services / acl-services/paprika

Make our core component uncontrolled.

オープン
#336 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Good First Issue Medium Priority →
主要言語
JavaScript
スター
54
フォーク
10
平均マージ
1日 12時間
マージ済み PR(30日)
6

説明

# Feature request

So far most of our core/basic component like input, select, checkbox are controlled component but there are lots of cases when we want to have an uncontrolled component and just listen for the onchange event. Should be simple to add this behaviour:

pseudo code ex:
```js
const Input = React.forwardRef((props, ref) => {
const [value, setValue] = React.useState(props.defaultValue);

function handleChange(event) {
if(defaultValue) {
setValue(() => event.target.value)
props.onChange(event.target.value)
return
}
props.onChange(event.target.value)
}
return
})
```

Something like that can be implemented in most of our components and be a pattern for basic ones.
## Additional context
*Add any other context or screenshots about the feature request here.*

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

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

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

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