mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: wip invoice customizer
This commit is contained in:
10
packages/webapp/src/utils/extract-children.ts
Normal file
10
packages/webapp/src/utils/extract-children.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
|
||||
export const extractChildren = <T extends React.ReactNode>(
|
||||
children: React.ReactNode,
|
||||
type: React.ElementType,
|
||||
): T[] => {
|
||||
return React.Children.toArray(children).filter(
|
||||
(node) => React.isValidElement(node) && node.type === type,
|
||||
) as T[];
|
||||
};
|
||||
Reference in New Issue
Block a user