gluestack / gluestack-ui

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

Wrapping Button and reexporting prevents ButtonGroup from working #1037

Closed capturetheworld closed 1 year ago

capturetheworld commented 1 year ago

Description

When Gluestack Button "GButton" is wrapped and reexported, ButtonGroup no longer work

CodeSandbox/Snack link

https://codesandbox.io/s/example-44622s

Steps to reproduce

  1. Import Button as GButton from library
  2. Export const Button with children props
  3. {children}
  4. If you wrap with a in another component it no longer works

gluestack-ui Version

0.1.32

Platform

Other Platform

No response

Additional Information

No response

Screenshot 2023-09-08 at 2 07 10 PM
makkarMeenu commented 1 year ago

@capturetheworld The codesandbox is not updated, could you please update that and let us know .

capturetheworld commented 1 year ago

@capturetheworld The codesandbox is not updated, could you please update that and let us know .

Hi, this is a code snippet from my project, I cannot share the entire project as the code is proprietary. This gives you enough of an idea of how I am exporting the Button component. See Lines 27-30 @makkarMeenu

makkarMeenu commented 1 year ago

@capturetheworld The codesandbox is not updated, could you please update that and let us know .

Hi, this is a code snippet from my project, I cannot share the entire project as the code is proprietary. This gives you enough of an idea of how I am exporting the Button component. See Lines 27-30 @makkarMeenu

Please try this snippet for wrapping the Button. Let me know if it works.

export const Button = ({ children , ...props}:any) => {
  return <GButton {...props}>{children}</GButton>;
};