Material-ui: ``makeStyles`` cannot be used in class Component

Created on 12 May 2019  路  1Comment  路  Source: mui-org/material-ui

  • [x] This is not a v0.x issue.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 馃

makeStyles can be used in class Component context

Current Behavior 馃槸

Steps to Reproduce 馃暪


Link:

1.
2.
3.
4.

Context 馃敠

Your Environment 馃寧

| Tech | Version |
|--------------|---------|
| Material-UI | v3.?.? |
| React | |
| Browser | |
| TypeScript | |
| etc. | |

question

>All comments

makeStyles is a 'hook factory', hooks can only be used in function components, therefore makeStyles will not work with class components

Was this page helpful?
0 / 5 - 0 ratings