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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect typing for Shape['borderRadius'] #32960

Closed
2 tasks done
MonstraG opened this issue May 31, 2022 · 2 comments 路 Fixed by #34076
Closed
2 tasks done

Incorrect typing for Shape['borderRadius'] #32960

MonstraG opened this issue May 31, 2022 · 2 comments 路 Fixed by #34076
Assignees
Labels
bug 馃悰 Something doesn't work package: system Specific to @mui/system typescript

Comments

@MonstraG
Copy link
Contributor

MonstraG commented May 31, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 馃槸

Shape interface is described like this:

export interface Shape {
  borderRadius: number | string;
}

but properties reference table mentions following theme mapping for borderRadius property: theme.shape.borderRadius * value, but you cannot multiply string * number

Expected behavior 馃

export interface Shape {
  borderRadius: number;
}

Steps to reproduce 馃暪

See context

Context 馃敠

This also forbids me from doing the exact same operation from the docs:
image

Your environment 馃寧

`npx @mui/envinfo`
  System:
    OS: Windows 10 10.0.22000
  Binaries:
    Node: 17.9.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 3.2.0 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD
  Browsers: N/A
  npmPackages:
    @emotion/react: ^11.9.0 => 11.9.0
    @emotion/styled: ^11.8.1 => 11.8.1
    @mui/base:  5.0.0-alpha.83
    @mui/icons-material: ^5.8.2 => 5.8.2
    @mui/lab: ^5.0.0-alpha.84 => 5.0.0-alpha.84
    @mui/material: ^5.8.2 => 5.8.2
    @mui/private-theming:  5.8.0
    @mui/styled-engine:  5.8.0
    @mui/system:  5.8.2
    @mui/types:  7.1.3
    @mui/utils:  5.8.0
    @mui/x-date-pickers:  5.0.0-alpha.1
    @types/react: ^18.0.9 => 18.0.9
    react: ^18.1.0 => 18.1.0
    react-dom: ^18.1.0 => 18.1.0
    typescript: ^4.7.2 => 4.7.2

@MonstraG MonstraG added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 31, 2022
@ZeeshanTamboli ZeeshanTamboli added bug 馃悰 Something doesn't work typescript package: system Specific to @mui/system and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 26, 2022
@MHebes
Copy link

MHebes commented Mar 1, 2023

I've run into the opposite problem now: I want to set my shape.borderRadius to be 20px, but I can't because it's a number.

@ZeeshanTamboli
Copy link
Member

@MHebes See the discussion in #35156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 馃悰 Something doesn't work package: system Specific to @mui/system typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants