-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: new @types/react support #392
Conversation
Could you elaborate why this is needed? If you don't provide a reproducible example of the bug then it's hard to judge if these changes are needed. |
@types/react added bigint support since v18.2.78, which currently seems to break typescript when building;
as classnames does not support this type. Same issue with clsx; lukeed/clsx#96 |
I don't think we ever explicitly supported passing in a |
For example if you want change some css based on if the children are passed into the component; import type { FC, PropsWithChildren } from 'react';
import classNames from 'classnames';
import css from './test.module.scss';
export const Test: FC<PropsWithChildren> = ({ children, className }) => {
const classes = classNames(
css.root,
children && css.hasChildren,
className,
);
return (
<div className={classes}>
<h1>Hello</h1>
{children}
</div>
)
} |
Thanks, I see your point. Since we have supported this historically I think we should land this, however this should be redirected to the |
You can merge it into main and then cherry pick this change into the v2 branch, maybe? Cuz the main also has the wrong typings |
No, this has to go into the v2 branch. The typings are correct for v3, and permutations there are likely to be reduced even further. |
Will create a new PR for that :) As changing the target branch pulls the commits in |
Support new @types/react version (v18.2.78 and higher)