You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
src/Checkbox.tsx:59:9 - error TS2322: Type '{ children: (Element | ReactNode | ((values: CheckboxRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]; }' is not assignable to type'{ children?: ReactNode; }'.
Types of property 'children' are incompatible.
Type '(Element | ReactNode | ((values: CheckboxRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]' is not assignable to type'ReactNode'.
Type '(Element | ReactNode | ((values: CheckboxRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]' is not assignable to type'Iterable<ReactNode>'.
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
Type 'IteratorResult<Element | ReactNode | ((values: CheckboxRenderProps & { defaultChildren: ReactNode; }) => ReactNode), undefined>' is not assignable to type'IteratorResult<ReactNode, any>'.
Type 'IteratorYieldResult<Element | ReactNode | ((values: CheckboxRenderProps & { defaultChildren: ReactNode; }) => ReactNode)>' is not assignable to type'IteratorResult<ReactNode, any>'.
Type 'IteratorYieldResult<Element | ReactNode | ((values: CheckboxRenderProps & { defaultChildren: ReactNode; }) => ReactNode)>' is not assignable to type'IteratorYieldResult<ReactNode>'.
Type 'Element | ReactNode | ((values: CheckboxRenderProps & { defaultChildren: ReactNode; }) => ReactNode)' is not assignable to type'ReactNode'.
Type '(values: CheckboxRenderProps & { defaultChildren: ReactNode; }) => ReactNode' is not assignable to type'ReactNode'.
59 <>~~
src/GridList.tsx:42:9 - error TS2322: Type '{ children: (Element | ReactNode | ((values: GridListItemRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]; }' is not assignable to type'{ children?: ReactNode; }'.
Types of property 'children' are incompatible.
Type '(Element | ReactNode | ((values: GridListItemRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]' is not assignable to type'ReactNode'.
Type '(Element | ReactNode | ((values: GridListItemRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]' is not assignable to type'Iterable<ReactNode>'.
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
Type 'IteratorResult<Element | ReactNode | ((values: GridListItemRenderProps & { defaultChildren: ReactNode; }) => ReactNode), undefined>' is not assignable to type'IteratorResult<ReactNode, any>'.
Type 'IteratorYieldResult<Element | ReactNode | ((values: GridListItemRenderProps & { defaultChildren: ReactNode; }) => ReactNode)>' is not assignable to type'IteratorResult<ReactNode, any>'.
Type 'IteratorYieldResult<Element | ReactNode | ((values: GridListItemRenderProps & { defaultChildren: ReactNode; }) => ReactNode)>' is not assignable to type'IteratorYieldResult<ReactNode>'.
Type 'Element | ReactNode | ((values: GridListItemRenderProps & { defaultChildren: ReactNode; }) => ReactNode)' is not assignable to type'ReactNode'.
Type '(values: GridListItemRenderProps & { defaultChildren: ReactNode; }) => ReactNode' is not assignable to type'ReactNode'.
42 <>~~
src/RadioGroup.tsx:48:23 - error TS2322: Type '{ children: (Element | ReactNode | ((values: RadioRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]; }' is not assignable to type'{ children?: ReactNode; }'.
Types of property 'children' are incompatible.
Type '(Element | ReactNode | ((values: RadioRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]' is not assignable to type'ReactNode'.
Type '(Element | ReactNode | ((values: RadioRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]' is not assignable to type'Iterable<ReactNode>'.
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
Type 'IteratorResult<Element | ReactNode | ((values: RadioRenderProps & { defaultChildren: ReactNode; }) => ReactNode), undefined>' is not assignable to type'IteratorResult<ReactNode, any>'.
Type 'IteratorYieldResult<Element | ReactNode | ((values: RadioRenderProps & { defaultChildren: ReactNode; }) => ReactNode)>' is not assignable to type'IteratorResult<ReactNode, any>'.
Type 'IteratorYieldResult<Element | ReactNode | ((values: RadioRenderProps & { defaultChildren: ReactNode; }) => ReactNode)>' is not assignable to type'IteratorYieldResult<ReactNode>'.
Type 'Element | ReactNode | ((values: RadioRenderProps & { defaultChildren: ReactNode; }) => ReactNode)' is not assignable to type'ReactNode'.
Type '(values: RadioRenderProps & { defaultChildren: ReactNode; }) => ReactNode' is not assignable to type'ReactNode'.
48 {renderProps =><>~~
src/TagGroup.tsx:110:9 - error TS2322: Type '{ children: (Element | ReactNode | ((values: TagRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]; }' is not assignable to type'{ children?: ReactNode; }'.
Types of property 'children' are incompatible.
Type '(Element | ReactNode | ((values: TagRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]' is not assignable to type'ReactNode'.
Type '(Element | ReactNode | ((values: TagRenderProps & { defaultChildren: ReactNode; }) => ReactNode))[]' is not assignable to type'Iterable<ReactNode>'.
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
Type 'IteratorResult<Element | ReactNode | ((values: TagRenderProps & { defaultChildren: ReactNode; }) => ReactNode), undefined>' is not assignable to type'IteratorResult<ReactNode, any>'.
Type 'IteratorYieldResult<Element | ReactNode | ((values: TagRenderProps & { defaultChildren: ReactNode; }) => ReactNode)>' is not assignable to type'IteratorResult<ReactNode, any>'.
Type 'IteratorYieldResult<Element | ReactNode | ((values: TagRenderProps & { defaultChildren: ReactNode; }) => ReactNode)>' is not assignable to type'IteratorYieldResult<ReactNode>'.
Type 'Element | ReactNode | ((values: TagRenderProps & { defaultChildren: ReactNode; }) => ReactNode)' is not assignable to type'ReactNode'.
Type '(values: TagRenderProps & { defaultChildren: ReactNode; }) => ReactNode' is not assignable to type'ReactNode'.
110 <>~~
Errors Files
1 src/Checkbox.tsx:59
1 src/GridList.tsx:42
1 src/RadioGroup.tsx:48
1 src/TagGroup.tsx:110
💁 Possible Solution
I'm not quite sure. The error seems off to me. I could use a second set of eyes on the error.
run npx npm-check-updates -i --format group,repo and install every dependency. If there is a lock conflict, run rm -rf node_modules package-lock.json && npm install && npm audit fix and repeat until there are no newer packages or conflicts
Add an npm script called check that runs tsc
run npm 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
The text was updated successfully, but these errors were encountered:
steveoh
changed the title
Updating typescript package displays type errors in starter kit
Updating typescript surfaces type errors in starter kit
Nov 26, 2024
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
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
The text was updated successfully, but these errors were encountered: