Open nikitarevenco opened 1 week ago
Everywhere in the library we are shadowing the className variable in the callback function (2nd argument to composeRenderProps):
className
composeRenderProps
className={composeRenderProps(className, (className) => cn("group flex flex-col gap-2", className), )}
It's problematic because a lot of projects use ESLint no-shadow rule. Which generates many errors for each of these files
no-shadow
Same with this:
{composeRenderProps(children, (children) => ( <> {children} <ChevronDown aria-hidden="true" className="size-4 opacity-50" /> </> ))}
children is being shadowed, changing it to something like renderChildren won't trigger ESLint errors
children
renderChildren
examples are taken from Select component
Select
The composeRenderProps isn't actually necessary at all in most cases and you can just do className={cn(...)}.
className={cn(...)}
Everywhere in the library we are shadowing the
className
variable in the callback function (2nd argument tocomposeRenderProps
):It's problematic because a lot of projects use ESLint
no-shadow
rule. Which generates many errors for each of these filesSame with this:
children
is being shadowed, changing it to something likerenderChildren
won't trigger ESLint errorsexamples are taken from
Select
component