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

Missing class prop on Button component fails Typescript complier #1319

Closed
vutran6853 opened this issue Jun 5, 2021 · 3 comments
Closed

Missing class prop on Button component fails Typescript complier #1319

vutran6853 opened this issue Jun 5, 2021 · 3 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@vutran6853
Copy link

I'm submitting a ... (check one with "x")

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110

Current behavior
I am using Vue 3 with typescript. import a button and want to add class to change the color. Get ts complier fail.

sample code

This is from the doc link: https://primefaces.org/primevue/showcase/#/button

<Button label="Submit" class="p-button-secondary" />

error message:
TS2322: Type '{ label: string; class: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'class' does not exist on type 'IntrinsicAttributes & ButtonProps'.

Expected behavior

Complier pass and not crash the app.
From source code of primevue interface ButtonProps is missing class property?

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Vue version: 3.X
  • PrimeVue version: 3.4.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
@west-farmer
Copy link

Same issue in version 2.4.2 on unpkg.com, and influenced many components.

@tugcekucukoglu
Copy link
Member

What is your exact test case and environment? I could not replicate it with primevue-typescript-quickstart.

@tugcekucukoglu tugcekucukoglu changed the title Missing class prop on Button component. Fail Typescript complier. Missing class prop on Button component fails Typescript complier Jun 23, 2021
@tugcekucukoglu tugcekucukoglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jun 23, 2021
@tugcekucukoglu tugcekucukoglu added this to the 3.5.2 milestone Jun 23, 2021
@tugcekucukoglu tugcekucukoglu self-assigned this Jun 23, 2021
@vutran6853
Copy link
Author

vutran6853 commented Jun 25, 2021

Thank for update on this issue.

FYI. For me, I am using Vue 3 with typescript using cli.

Example code:

// App.tsx
import { defineComponent } from 'vue';
import Button from 'primevue/button'

export default defineComponent({
  name: 'App',
  render() {
    return (
      <div>
        <Button label="Submit" class="p-button-secondary" />
      </div>
    )
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants