import React from 'react';
interface MyComponentProps {
children: (items: string[]) => void;
regexp: RegExp;
items: string[];
}
export const MyComponent: React.FC<MyComponentProps> = ({ children, items, regexp }) => {
return children(items.filter(item => regexp.test(item)));
}