Reputation: 63
Using React and classnames to do styles. I get no errors but I get undefined when I console.log(styles.uiPad). I do get an object when I console.log(styles). My classnames import component also gets console.logged successfully but nothing happens. What am I doing wrong? Is this a webpack thing?
Here are my imports:
import styles from '../assets/stylesheets/base.scss'
import classNames from 'classnames'
This is my render:
<div className={classNames(styles.uiPad)}></div>
Upvotes: 0
Views: 144
Reputation: 142
You are importing a Sass file. You need to compile Sass into CSS before importing it.
Upvotes: 1