خرید بک لینک

Vote count: 0

CSS Modules work like a charm with React Component classes, however, when I try to implement them in my pure components (i.e. without classes), Webpack is not able to compile the code:

Here's a simple component:

import React from 'react';
import styles from './Button.scss';

const Button = ({ text, onClick }) => {
  retu (
    <button type="button"
            onClick={onClick}
            className={`${styles.button} btn btn-primary btn-lg btn-block`}>
      {text}
    </button>
  );
};

export default Button;

... and the styles

// TESTING

:global {
  .btn-primary {
    background: red !important;
  }
}

.button {
  background: red !important;
}

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 24 خرداد 1395 ساعت: 10:46

صفحه بندی