I am facing an issue with some variables set at the top of my functional component that are not being used except in styles:
const testWidth = 100;
const testHeight = 100;
Although I use some of these variables in my styles...
I am considering moving my styles to another file, related to a class name like '.divWrapperStyle
', but I'm unsure about how to interact with the variable 'testWidth
'
<div
style={{
borderBottom: 0,
width: `${testWidth}px`,
width: 'auto',
paddingRight: 0,
paddingLeft: 0,
paddingTop: 20,
}}
>
I am thinking of creating a separate .css
file like this:
.wrapper{
borderBottom: 0,
paddingRight: 0,
paddingLeft: 0,
paddingTop: 20,
}
After importing that file, I might use something like:
<div className="wrapper>
But how can I include the value of testWidth
for the width property?
The variables used in CSS are causing some difficulties for me :/
Any suggestions on how to address this issue would be greatly appreciated!