in packages/synchro-charts-react/src/react-component-lib/createComponent.tsx [29:56]
render() {
const { children, forwardedRef, style, className, ref, ...cProps } = this.props;
const propsToPass = Object.keys(cProps).reduce((acc, name) => {
const isEventProp = name.indexOf('on') === 0 && name[2] === name[2].toUpperCase();
const isDataProp = name.indexOf('data-') === 0;
const isAriaProp = name.indexOf('aria-') === 0;
if (isEventProp) {
const eventName = name.substring(2).toLowerCase();
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
(acc as any)[name] = (cProps as any)[name];
}
} else if (isDataProp || isAriaProp) {
(acc as any)[name] = (cProps as any)[name];
}
return acc;
}, {});
const newProps: any = {
...propsToPass,
ref: this.ref,
style,
className,
};
return React.createElement(tagName, newProps, children);
}