I have a little problem with layout elements. I have scss style sheets in a separate file and importing them into an answer file. My scss style is as follows:
.testStyle {
font-family: avenir;
color: blue;
}
My reaction file is as follows:
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 setting, my styles are not passed, however, if it works, if I replace the selected line with <div className='testStyle'>, so it seems that the styles are imported correctly. Can anyone help with this? Thank.
source
share