Property 'appkit-button' does not exist on type 'JSX.IntrinsicElements'. #3427
Replies: 1 comment
-
Let me explain the error and solution in a clear, step-by-step wayThe Problem:The error occurs because TypeScript doesn't recognize The Solution:Create a file called custom-elements.d.ts (or any name ending in .d.ts) in your project root and add this code: import React from "react";
declare module "react" {
namespace JSX {
interface IntrinsicElements {
"appkit-button": React.DetailedHTMLProps<
React.ButtonHTMLAttributes<HTMLButtonElement> & {
disabled?: boolean;
balance?: "show" | "hide";
size?: "md" | "sm";
label?: string;
loadingLabel?: string;
},
HTMLButtonElement
>;
}
}
} What This Does:.d.ts files are TypeScript declaration files After Adding the File If you're using another web component later, don't forget to include it also. |
Beta Was this translation helpful? Give feedback.
-
Getting this error (the title) in my code. My Navbar where I am using it and getting the error at looks like this:
This is my layout page, this is where I think something is going wrong regarding passing the props.
The code is running fine in dev server. But the error is popping up when I am trying to deploy in Vercel
Beta Was this translation helpful? Give feedback.
All reactions