Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!theme) {
throw new Error(
"createComponent() can't render styles without the theme in the context. Wrap the root of your app with ."
);
}
// compose passThrough props from arrays or functions
const resolvedPassThrough = [
...resolvePassThrough(passThroughProps, ruleProps)
];
if (ruleProps.className) {
console.warn(`You cannot restyle Fela component ${componentName}`);
}
const componentProps = extractPassThroughProps(
resolvedPassThrough,
ruleProps
);
ruleProps.theme = theme || {};
if (ruleProps.style) {
componentProps.style = ruleProps.style;
}
componentProps.className = renderer.renderRule(rule, ruleProps);
if (ruleProps.id) {
componentProps.id = ruleProps.id;
}