Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No props validation for Typescript users? #168

Open
gfang200 opened this issue Aug 14, 2022 · 0 comments
Open

No props validation for Typescript users? #168

gfang200 opened this issue Aug 14, 2022 · 0 comments

Comments

@gfang200
Copy link

Does Glean support typing props when extracting components?

For example, extracting the middle component:

 const hello = 'hello';
()=>{
  <div>
  <div>Hello world {hello}</div>
  <div>
}

returns a functional component where hello is cast as any

function HelloWorldComponent({hello}) {
  return (<div>Hello world {hello}</div>);
}

I'm wondering if it's possible infer and set the prop type, or do I need to set it manually in all cases?

function HelloWorldComponent({hello}:{hello:string}) {
   return (<div>Hello world {hello}</div>);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant