Currently utilizing NextJS, I have a route named about
that is displayed through page.js
. Within /about/page.js
, I am incorporating a component called <Hero />
and aiming to pass a prop to
<Hero heroHeight={'height: 400px'} />
to my CSS module
to aid in styling.
Hero.js
'use client';
import styles from '../page.module.css';
import style from './Hero.module.css';
const Hero = ({ heroHeight }) => {
return (
<div className={`${styles.pageWidth} ${style[heroHeight.updateTheHeight]`}>
</div>
);
};
export default Hero;
Hero.module.css
.updateTheHeight{
border: 1px solid green;
/* Aim to pass the prop 'height: 400px' here */
}
The current code is not functioning as intended. I aim to pass the prop value of height: 400px to the .updateTheHeight class. Can anyone assist in identifying the issue in my code? Any guidance is highly appreciated. Thank you!