Open ritmillio opened 2 weeks ago
this will fix it.
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[
index
] as SlotProps
this will fix it.
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[ index ] as SlotProps
I have the following error with this solution:
Use a ! assertion to more succinctly remove null and undefined from the type.eslint@typescript-eslint/non-nullable-type-assertion-style
hey @ritmillio input-otp maintainer here 👋🏻
could not reproduce it locally.
can you provide a stackblitz?
Ran into the same issue today, fresh install from shadcn.
Ran into the same issue today, fresh install from shadcn.
I reinstalled my project with PNPM instead of Bun, problem solved.
Hey, @guilhermerodz
Here's a minimum reproduction of my use-case: https://stackblitz.com/edit/stackblitz-starters-9avgfk?file=src%2Fcomponents%2Fui%2Finput-otp.tsx
@keeandev - I am using pnpm but reinstalling didn't solve my problem
Hey, @guilhermerodz
Here's a minimum reproduction of my use-case: https://stackblitz.com/edit/stackblitz-starters-9avgfk?file=src%2Fcomponents%2Fui%2Finput-otp.tsx
@keeandev - I am using pnpm but reinstalling didn't solve my problem
Apologies, I had a very similar issue, but I solved this issue by putting an exclamation mark at the end of the line.
Describe the bug
After installation of the input-otp component I am getting a build error in Next.js - using TypeScript.
The error occurs here:
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
Property 'char' does not exist on type 'SlotProps | undefined'.ts(2339) Property 'hasFakeCaret' does not exist on type 'SlotProps | undefined'.ts(2339) Property 'isActive' does not exist on type 'SlotProps | undefined'.ts(2339)
Affected component/components
Input OTP
How to reproduce
Install input-otp.
Setup eslint: eslintrc.cjs:
Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting