하루 기록

console warning 잡기 본문

Today I Learned/in dev

console warning 잡기

떼굴펜 2024. 8. 4. 12:03

1. [DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`

변경 전 변경 후

import 
create from "zustand";
 

import 
{ create } from "zustand";
 

 

2. Image with src has either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles 'width: "auto"' or 'height: "auto"' to maintain the aspect ratio.

변경 전 변경 후
      <Image
        src={src}
        alt={alt}
        fill
        className={clsx(imageClassName)}
      />
      <Image
        src={src}
        alt={alt}
        fill
        sizes="width:auto, height:auto"
        className={clsx(imageClassName)}
      />

 

 

3. Image with src either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles 'width: "auto"' or 'height: "auto"' to maintain the aspect ratio.

변경 전 변경 후
            <Image
              src={src}
              alt="type"
              width={16}
              height={16}
            />
            <Image
              src={src}
              alt="type"
              width={16}
              height={16}
              className="w-4 h-4"
            />