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

Fix #6334: typescript definition for Stepper and StepperPanel #6356

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

dvpritzbuer
Copy link
Contributor

Fix #6334: typescript definition for Stepper and StepperPanel

Copy link

vercel bot commented Apr 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Apr 10, 2024 3:44am
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Apr 10, 2024 3:44am

@melloware melloware added the Typescript Issue or pull request is *only* related to TypeScript definition label Apr 9, 2024
@melloware
Copy link
Member

@gucal @nitrogenous @mertsincan did we not use React.PropsWithChildren because its React 18 only and we wanted to be backward compatible with React 17? https://stackoverflow.com/questions/71788254/react-18-typescript-children-fc

Is that why we declare children in most components like this:

    /**
     * Used to get the child elements of the component.
     * @readonly
     */
    children?: React.ReactNode | undefined;

??

@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Apr 9, 2024
@dvpritzbuer
Copy link
Contributor Author

@melloware
seems to work fine with react 17.0.2 - here is a stackblitz example: https://stackblitz.com/edit/vitejs-vite-9iwtma?file=src%2FApp.tsx

@melloware
Copy link
Member

nice!

@dvpritzbuer
Copy link
Contributor Author

I've recognized the Stepper does have a ref property and was missing the definition for that.

Updated the branch with a proposed solution. I'm not sure about naming and the documentation part, but at least you have a general example of how the typing could work with the ref and custom methods.

@melloware melloware removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Apr 12, 2024
@melloware melloware merged commit 0c40187 into primefaces:master Apr 16, 2024
5 checks passed
@dvpritzbuer dvpritzbuer deleted the issue-6334 branch April 16, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typescript Issue or pull request is *only* related to TypeScript definition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StepperPanel: New const instead of class components are no valid JSX.Element's
2 participants