Skip to content

Rename className param used in the callback function within composeRenderProps #80

Description

@nik-rev

Everywhere in the library we are shadowing the className variable in the callback function (2nd argument to 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

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

examples are taken from Select component

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions