Skip to content

Commit

Permalink
feat: allow multiple children to be passed to ConfirmDocumentUnload c…
Browse files Browse the repository at this point in the history
…omponent (#3372)
  • Loading branch information
davwheat authored Apr 3, 2022
1 parent a7dd0b2 commit 803f4cc
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ import Component from '../Component';
*
* - `when` - a callback returning true when the browser should prompt for
* confirmation before closing the window/tab
*
* ### Children
*
* NOTE: Only the first child will be rendered. (Use this component to wrap
* another component / DOM element.)
*
*/
export default class ConfirmDocumentUnload extends Component {
handler() {
Expand All @@ -35,8 +29,6 @@ export default class ConfirmDocumentUnload extends Component {
}

view(vnode) {
// To avoid having to render another wrapping <div> here, we assume that
// this component is only wrapped around a single element / component.
return vnode.children[0];
return <>{vnode.children}</>;
}
}

0 comments on commit 803f4cc

Please sign in to comment.