Passing in class names to react components

前端 未结 9 787
说谎
说谎 2020-12-23 02:35

I am trying to pass in a classname to a react component to change it\'s style and cannot seem to get working:

class Pill extends React.Component {

  render(         


        
9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 03:07

    With React 16.6.3 and @Material UI 3.5.1, I am using arrays in className like className={[classes.tableCell, classes.capitalize]}

    Try something like the following in your case.

    class Pill extends React.Component {
        render() {
            return (
               
            );
        }
    }
    

提交回复
热议问题