mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
feat(webapp): import resource UI
This commit is contained in:
17
packages/webapp/src/utils/is-element.ts
Normal file
17
packages/webapp/src/utils/is-element.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
|
||||
export function isElement(value: any): value is React.ReactElement {
|
||||
if (Array.isArray(value) || value === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof value === 'object') {
|
||||
if (value.type === React.Fragment) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user