I'm having a little issue with styling react components. I have my scss stylesheets in a separate file and importing them into my react file. My scss stylsheet looks like this:
.testStyle {
font-family: avenir;
color: blue;
}
My react file, looks like this:
import React from 'react'
import styles from '../styles/main.scss'
class Temp extends React.Component {
render() {
return (
**<div className={styles.testStyle}>**
<h1>Hello</h1>
</div>
)
}
}
export default Temp
With this setup, my styles are not passed through, however, if it works if I replace the starred line with <div className='testStyle'>
, so it seems like the styles are being imported correctly. Can anyone help with this? Thanks.