Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const reshadowStyled = createReshadowStyled((element, as, props, filtered) => {
const style = coreStyled[KEYS.__style__];
if (style) {
props.style = Object.assign({}, style, props.style);
}
props = map(element, props);
if (filtered) {
for (let i = 0; i < filtered.length; i++) {
delete props[filtered[i]];
}
}
const result = React.createElement(as, props);
if (style && result.props.style === props.style) {
return result;
}
return React.cloneElement(result, {
style: Object.assign({}, style, result.props.style),
});
export function jsx() {
const args = Array.prototype.slice.call(arguments);
let element = args[0];
if (typeof element === 'string' && !tags.has(element)) {
args[0] = 'div';
} else if (typeof element === 'function') {
element = getDisplayName(element);
}
args[1] = map(element, args[1]);
return React.createElement.apply(null, args);
}
const map = (element, data) => {
if (!data.attrs) return data;
data.attrs.class = data.class;
data.attrs.style = data.style;
data.attrs = _map(element, data.attrs);
data.class = data.attrs.class;
data.style = data.attrs.style;
delete data.attrs.class;
delete data.attrs.style;
return data;
};