gluestack / gluestack-ui

React & React Native Components & Patterns (copy-paste components & patterns crafted with Tailwind CSS (NativeWind))
https://gluestack.io/
MIT License
2.79k stars 121 forks source link

Missing displayName on Components #2597

Open dacitto opened 2 days ago

dacitto commented 2 days ago

Description

The components in gluestack do not include a displayName, making it challenging to debug and work with them in tools like React Developer Tools. Without displayName, components appear as Anonymous, which affects the developer experience.

Problem Statement

Since I use the ESLint rule react/display-name to enforce best practices, gluestack components trigger errors during linting. This adds unnecessary overhead, requiring me to disable the rule for these components or manually assign displayName to them.

Proposed Solution or API

Add a displayName to all gluestack components.

const Button = () => {
  return <button>Click me</button>;
};
Button.displayName = "Button";

Alternatives

No response

Additional Information

I’d be happy to contribute to resolving this issue.

Viraj-10 commented 17 hours ago

Hey @vaibhk20, We've added the displayName property to all of our components. Could you please let us know which component you're experiencing this issue with?