cssinjs/jss

[jss-compose] When composing from a class that takes props, the inheriting class needs props also

オープン

#1,319 opened on 2020/03/22

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (434 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (7,000 個のスター)
PR merge metrics
 (PR metrics pending)

説明

I have a class that takes props, when I extend it, the extension doesn't work unless the class that extends also takes props.

const useStyles = makeStyles({
  icon: props => ({ // <---------- base class
    fontSize: Number(props.size)
  }),
  successIcon: props => ({
    composes: '$icon', // This works, because it takes props, even though not using them
    color: 'green'
  }),
  failIcon: {
    composes: '$icon',  // This extension should work, but it doesn't
    color: 'red'
  }
})

React-JSS 10.1.1 Material UI 4.9.7

コントリビューターガイド