0

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>
rrudy90023
  • 63
  • 2
  • 8

1 Answers1

1

You are importing a Sass file. You need to compile Sass into CSS before importing it.

Smaft
  • 142
  • 10