question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should classes be optional in withStyles

See original GitHub issue

https://github.com/mui-org/material-ui/blob/v1-beta/src/styles/withStyles.d.ts#L32

Would it make sense for this to be optional so that I don’t end up with components that expect me to provide classes?

Type '{ tags: string[]; onChange: () => any; }' is not assignable to type 'IntrinsicAttributes & Props & StyledComponentProps<"root"> & { children?: ReactNode; }'.
  Type '{ tags: string[]; onChange: () => any; }' is not assignable to type 'Props'.
    Property 'classes' is missing in type '{ tags: string[]; onChange: () => any; }'.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
atrauzzicommented, Feb 22, 2018

And suddenly there was peace in my compiler again. Phew, thanks for the lesson. I think I’m going to go clean up all my props now and probably eliminate a whole bunch of issues.

Seriously, thank you so much!

0reactions
eps1loncommented, Feb 1, 2019

Closing this since the original issue was resolved and the new issue is incomplete.

@atrauzzi If you still encounter problems please open a new issue and follow the template.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should classes be optional in withStyles · Issue #10357 - GitHub
Should classes be optional in withStyles #10357 ... One thing you can do is separate WithStyles from your props (this is how we...
Read more >
How to type classes when passing them as a prop in material ui
You can style a material-ui component by passing a single string className ... The type Styles<Theme, Props, ClassKey> takes three optional ...
Read more >
Styles API - MUI System
The string used to prefix the class names in production. options.seed (string [optional]): Defaults to '' . The string used to uniquely identify...
Read more >
Styles and classes - The Modern JavaScript Tutorial
We should always prefer CSS classes to style . The latter should only be used if classes “can't handle it”. For example, style...
Read more >
Going to school is optional: Schools need to engage students ...
Moreover, unexcused class absences on days when students are in school explains almost all of the increase in total absences in high school....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found