Open steveoh opened 3 days ago
I've hit the same issue when updating my project to the latest typescript release. I reverted to version 5.6.3 and no longer see the error.
I can't figure out why it's only coming to light with ts 5.7, but I believe it has to do with the type of children (GridListItemProps, CheckboxProps, RadioProps, because the 4 components can take children as a function whereas the tailwind starter assumes these render props are used in the reusable component and just returns a ReactNode as a child.
so either check if the child is a function and pass the arguments, as below, or augment the props and only allow ReactNode
<AriaCheckbox
{...props}
ref={ref}
className={composeRenderProps(props.className, (className, renderProps) =>
checkboxStyles({
...renderProps,
isInvalid: props.isInvalid,
className,
}),
)}
>
{({ isSelected, isIndeterminate, ...renderProps }) => (
<>
<div
className={boxStyles({
isSelected: isSelected || isIndeterminate,
...renderProps,
})}
>
{isIndeterminate ? (
<Minus aria-hidden className={iconStyles} />
) : isSelected ? (
<Check aria-hidden className={iconStyles} />
) : null}
</div>
{typeof props.children === "function"
? props.children({ isSelected, isIndeterminate, ...renderProps })
: props.children}
</>
)}
</AriaCheckbox>
OR
export const Checkbox = React.forwardRef(function Checkbox(
props: Omit<CheckboxProps, "children"> & { children?: ReactNode },
ref: React.Ref<HTMLLabelElement>,
)...
Provide a general summary of the issue here
Updating the packages in the tailwind starter kit after downloading the
ab9fd5c68
build has typescript errors.๐ค Expected Behavior?
The types should be good regardless of the typescript version used
๐ฏ Current Behavior
Running
tsc
on the default codebase throw errors in 4 components.๐ Possible Solution
I'm not quite sure. The error seems off to me. I could use a second set of eyes on the error.
๐ฆ Context
๐ฅ๏ธ Steps to Reproduce
npx npm-check-updates -i --format group,repo
and install every dependency. If there is a lock conflict, runrm -rf node_modules package-lock.json && npm install && npm audit fix
and repeat until there are no newer packages or conflictsnpm run check
Version
1.5.0
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
If other, please specify.
No response
What operating system are you using?
macos
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response