NextJS Image component not responding to my inline css inside it

Viewed 702

Why isn't styling inside the Image component in NextJS not allowing me to manipulate my image. Am I missing something?

<Image className={styles.bg}
        style={{ transform: `translateY(${offset * 0.5}px)` }}
        src="/../public/bg.jpg"
        // width={2049}
        // height={2049}
        // objectFit="cover"
        layout="fill"
        quality={100}
      />
2 Answers

Other properties on the component will be passed to the underlying img element with the exception of the following:

style. Use className instead.

NextJs v12.1.1 added the style prop to next/image.

Related