react-component / react-component/util

useMergedState.ts

Open
#264 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
670
Forks
205
Avg merge
11d 17h
Merged PRs (30d)
4

Description

In triggerChange function, why not ignore setInnerValue when value present, i.e. controlled mode. I suppose innerValue does not take any effect in controlled mode though.

In addition, it should be nice to add some logic detecting the switch controlled and uncontrolled mode, throw an error/warning as native react dose https://github.com/facebook/react/issues/5821.

Not sure if I am missing some points though, if the above idea make any sense. I am glad to implement the code

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in useMergedState.ts at triggerChange and trace how value and innerValue are handled. Confirm the intended controlled-mode behavior and controlled/uncontrolled transition warning with maintainers before defining tests and completion criteria; this is an open proposal without existing tests or a decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.