@winglet/react-utils
Version:
React utility library providing custom hooks, higher-order components (HOCs), and utility functions to enhance React application development with improved reusability and functionality
16 lines (13 loc) • 448 B
JavaScript
import { isReactComponent } from '../filter/isReactComponent.mjs';
import 'react';
const remainOnlyReactComponent = (dictionary) => {
const result = {};
const keys = Object.keys(dictionary);
for (let i = 0, k = keys[0], l = keys.length; i < l; i++, k = keys[i]) {
const value = dictionary[k];
if (isReactComponent(value))
result[k] = value;
}
return result;
};
export { remainOnlyReactComponent };