When I create a function to return a DOM element with an associated className, the local style doesn't seem to be applied. For example:
export default function thing(){
const elem = function(){
return (<div className="myCss">Hello</div>)
}
return(
<>
{ elem() }
<style jsx>{` .myCss{ color:#f00 } `}</style>
</>
)
}
I expected that elem() would return an element that inherits the style associated with the .myCss class. However, it doesn't work as expected.