Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderRule(rule: Function, props: Object = {}): Object {
const style = rule(props)
const reference = JSON.stringify(style)
if (!renderer.cache.hasOwnProperty(reference)) {
const processedStyle = processStyleWithPlugins(
renderer,
style,
RULE_TYPE
)
renderer.cache[reference] = StyleSheet.create({
style: processedStyle
})
}
return renderer.cache[reference].style
}
}
renderer.renderRule = (rule: Function, props: Object = {}): string => {
const processedStyle = processStyleWithPlugins(
renderer,
rule(props),
RULE_TYPE
)
return renderer._renderStyleToClassNames(processedStyle, rule)
}