Closed chardy closed 4 years ago
I try to use css module to do the styling and it's not working. It return undefined.
import React from "react"; import PropTypes from "prop-types"; import style from "./styles.css"; const Button = ({ onClick, disabled, className, text }) => ( <button type="button" className={style.button} onClick={onClick} disabled={disabled} > {text} </button> ); Button.propTypes = { onClick: PropTypes.func, /** Disable the button */ disabled: PropTypes.bool, className: PropTypes.string, /** Text of the button */ text: PropTypes.string }; Button.defaultProps = { onClick: () => {}, disabled: false, className: null, text: "Click Me" }; export default Button;
@chardy in rollup.config change to:
rollup.config
postcss({ modules: true, autoModules: true, plugins: [], minimize: true, sourceMap: "inline" })
I try to use css module to do the styling and it's not working. It return undefined.