creativetimofficial / material-tailwind

@material-tailwind is an easy-to-use components library for Tailwind CSS and Material Design.
https://material-tailwind.com/
MIT License
3.51k stars 307 forks source link

"{ children: Element; className: string; key: any; } attribute "placeholder" is missing in "placeholder" #535

Closed peterwang-s closed 6 months ago

peterwang-s commented 6 months ago

The original project ran without any problems, but when I removed yarn.lock and node_module and reinstalled them, most components started with TS errors, with messages like 'Attribute "placeholder" is missing in'

Type "{children: Element; className: string;  key: any;  Attribute "placeholder" is missing in "}", but type "Pick< MenuItemProps & ButtonHTMLAttributes< HTMLButtonElement> , "title" | "value" | "form" | "slot" | "style" | "children" | ...  262 more ...  | "name">"  This property is required in. ts(2741)
image

In the screenshot, you can see that 'MenuItem' and 'Typography' are starting to report the same error in the latest installation

Reading the component type definition, placeholder attributes are not declared required

Is there an error with the latest package content? How do I fix this

Environment

"dependencies": {
    "@heroicons/react": "^2.0.18",
    "@material-tailwind/react": "^2.1.7",
    "cookie": "^0.6.0",
    "next": "14.0.3",
    "qs": "^6.11.2",
    "react": "^18",
    "react-dom": "^18",
    "use-react-countries": "^1.1.0"
  },
  "devDependencies": {
    "@types/cookie": "^0.6.0",
    "@types/node": "^20",
    "@types/qs": "^6.9.10",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10.0.1",
    "eslint": "^8",
    "eslint-config-next": "14.0.3",
    "postcss": "^8",
    "tailwindcss": "^3.3.0",
    "typescript": "^5"
  }
don-esteban commented 6 months ago

See just a few issues below #528