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

hoverOpacity not exposed/defined in TypeAction interface for createPalette; causes typescript error when trying to override. #12450

Closed
rue-kchavan opened this issue Aug 8, 2018 · 2 comments
Labels
bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process. typescript

Comments

@rue-kchavan
Copy link

rue-kchavan commented Aug 8, 2018

Issue: hoverOpacity field not defined in TypeAction interface used in createPalette.

Steps:

  1. When trying to overrride the default theme by material ui as follows:
export default {
  palette: {
    primary: {
      main: '#354954',
    },
    action: {
      active: 'rgba(255, 255, 255, 0.20)',
      hover: 'rgba(255, 255, 255, 0.15)',
     hoverOpacity: 0.10,
    },
 }
}

Results in typescript error.

Object literal may only specify known properties, and 'hoverOpacity' does not exist in type 'Partial<TypeAction> | undefined'.```
Is there going to be a fix for this soon?

| Tech         | Version |
|--------------|---------|
| Material-UI  |  v0.20.1  |
| React        |    16.4.1     |
| browser      |  chrome |
@oliviertassinari oliviertassinari added good first issue Great for first contributions. Enable to learn the contribution process. typescript labels Aug 8, 2018
@oliviertassinari
Copy link
Member

@rue-kchavan You are right, we miss the hoverOpacity definition in:
https://github.com/mui-org/material-ui/blob/c937ab0f3b0a82b94de148d90d482534a542fc0c/packages/material-ui/src/styles/createPalette.d.ts#L11-L17

Do you want to submit a pull request to fix it?

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Aug 8, 2018
@rue-kchavan
Copy link
Author

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process. typescript
Projects
None yet
Development

No branches or pull requests

2 participants