gluestack / gluestack-ui

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

Type intellisense suggestion doens't work #1174

Closed amerllica closed 11 months ago

amerllica commented 11 months ago

Description

For example the Button component, component should suggest its own props, but it doesn't happen.

CodeSandbox/Snack link

https://snack.expo.dev/@amerllica/b2a79c?platform=web&theme=dark

Steps to reproduce

  1. Write import { Button as ButtonGS } from "@gluestack-ui/themed";
  2. type , after ButtonGS and try to import ButtonProps.
  3. It doesn't exist.

gluestack-ui Version

^0.1.51

Platform

Other Platform

No response

Additional Information

I expected the types of components to be exported but those were not at all. There is no possibility to use glue stack component types. For example, the following code is a wrapper component upon the glue stack button component:

import * as React from "react";
import type { FC } from "react";
import { Button as ButtonGS } from "@gluestack-ui/themed";

type ButtonGSType = React.ComponentProps<typeof ButtonGS>;
export interface ButtonProps extends ButtonGSType {
  children?: React.ReactNode;
}

const Button: FC<Partial<ButtonProps>> = ({ children, ...rest }) => {
  return <ButtonGS {...rest}>{children}</ButtonGS>;
};

export { Button };

The ButtonGS component doesn't suggest anything, even by using this wrapper and force of type ButtonGSType = React.ComponentProps<typeof ButtonGS>; to get exported the types, my own exported component only suggests Text, Icon, Group, Spinner.

amerllica commented 11 months ago

If this is acceptable to you I can send a PR

Viraj-10 commented 11 months ago

Hey @amerllica, We will export typing is in the pipeline. We will export them soon.

amerllica commented 11 months ago

Thanks @Viraj-10, I completely migrate from GlueStack to ReactNativeElements. I think nowadays when a TypeScript project wants to be built, first of all, the types would be necessary.

dversan commented 8 months ago

Hey @amerllica, We will export typing is in the pipeline. We will export them soon.

Hi @Viraj-10, there are some news about this issue? Thanks

udaykumar-bejjam commented 6 months ago

Is there any update on types? I am also facing the same issue.

jerrywonderr commented 2 months ago

I am currently facing this also, any update yet?

amerllica commented 2 months ago

No @jerrywonderr, please don't trust this repo. When contributor developers tried to write some codes by using TypeScript and then put any anywhere, so, there was/is no hope or trust in this product. It's not reliable at all.

jerrywonderr commented 2 months ago

This isn't nice. I guess I will use another library. Thanks @amerllica