mui / mui/base-ui

[all components] Decide on a common generic `value` type

Open
#1,076 6 comments 6 reactions 0 assignees View on GitHub
breaking change scope: all components
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

Current situation:

value: any
- Select
- Menu Radio
- Menu Radio Group
- Toggle Group
- Tabs

value: unknown
- Field (in `validate` callback)
- Radio
- Radio Group

value: string
- Toggle Group
- Select.Value (in `children` render function)

***

My preferences/suggestions:
- We can't use `unknown` because it comes with a difficult DX
- `any` is OK but might be a footgun with non-primitive values causing unexpected rerenders due to different references. I could go either way though as it's more powerful too.
- Any potential issues with non-primitive values in forms?
- Toggle needs to align with whatever everything else is using
- Select.Value needs to use the actual `value` type for the `children` render function

**Search keywords**:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.