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 cloneElement Typescript definition #1197

Merged
merged 3 commits into from Aug 25, 2018
Merged

Fix cloneElement Typescript definition #1197

merged 3 commits into from Aug 25, 2018

Conversation

hiddedejong
Copy link
Contributor

This adds the optional third argument to the cloneElement function's Typescript definition.

The cloneElement function accepts an optional third argument to override the cloned element's children.
@coveralls
Copy link

coveralls commented Aug 24, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling f9d853b on hiddedejong:patch-1 into 2e53084 on developit:master.

src/preact.d.ts Outdated
@@ -114,7 +114,7 @@ declare namespace preact {

function render(node: ComponentChild, parent: Element | Document | ShadowRoot | DocumentFragment, mergeWith?: Element): Element;
function rerender(): void;
function cloneElement(element: JSX.Element, props: any): JSX.Element;
function cloneElement(element: JSX.Element, props: any, children?: ComponentChildren): JSX.Element;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be a rest argument like ...children

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for your PR 🎉

@hiddedejong
Copy link
Contributor Author

Thank you for your feedback and work on this great library!

@marvinhagemeister marvinhagemeister merged commit cb67a81 into preactjs:master Aug 25, 2018
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

Successfully merging this pull request may close these issues.

None yet

3 participants