1

如何将 CSS 模块类名作为不同于 的道具传递styleName

import './MyStyles.css'

<ThirdPartyComponent
  styleName='this-works'
  activeClassName='i want to pass my css module classes here' />
4

1 回答 1

3
import styles from './MyStyles.css'

<ThirdPartyComponent
    className={styles['this-works']}
    activeClassName={styles['my-css-module-class-name']}
/>
于 2018-03-15T12:48:41.453 回答