rollup-plugin-data-qa
Version:
[](https://www.npmjs.com/package/rollup-plugin-data-qa) [](https://github.com/semantic-releas
11 lines (10 loc) • 526 B
JavaScript
import { JSX_CALLEE_NAMES } from "../../../pluginConstants.js";
import isReactFragment from "../isReactFragment/index.js";
//#region src/utils/react/isReactNode/index.ts
function isReactNode(node) {
const isReactCreateElement = node?.callee?.object?.name === "React" && node?.callee?.property?.name === "createElement";
const isJsxAndNotFragment = JSX_CALLEE_NAMES.includes(node?.callee?.name) && !isReactFragment(node);
return isReactCreateElement || isJsxAndNotFragment;
}
//#endregion
export { isReactNode as default };