Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[base-ui] Replace array API with ReadOnlyArray #40759

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/mui-base/src/Unstable_Popup/Popup.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface PopupOwnProps {
*
* @see https://floating-ui.com/docs/computePosition#middleware
*/
middleware?: Array<PopupMiddleware | null | undefined | false>;
middleware?: ReadonlyArray<PopupMiddleware | null | undefined | false>;
/**
* Distance between a popup and the trigger element.
* This prop is ignored when custom `middleware` is provided.
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/useSlider/useSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ function focusThumb({
}

function areValuesEqual(
newValue: number | Array<number>,
oldValue: number | Array<number>,
newValue: number | Readonly<number> | Array<number>,
oldValue: number | Readonly<number> | Array<number>,
): boolean {
if (typeof newValue === 'number' && typeof oldValue === 'number') {
return newValue === oldValue;
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/useSlider/useSlider.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export interface UseSliderParameters {
* The value of the slider.
* For ranged sliders, provide an array with two values.
*/
value?: number | number[];
value?: number | Readonly<number>;
}

export interface Mark {
Expand Down
Loading