Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const renderWithFocusZone = <p>(
render: RenderComponentCallback</p><p>,
focusZoneDefinition: FocusZoneDefinition,
config: RenderResultConfig</p><p>,
): any => {
if (focusZoneDefinition.mode === FocusZoneMode.Wrap) {
return wrapInGenericFocusZone(
FocusZone,
{
...focusZoneDefinition.props,
isRtl: config.rtl,
},
render(config),
)
}
if (focusZoneDefinition.mode === FocusZoneMode.Embed) {
const originalElementType = config.ElementType
config.ElementType = FocusZone as any
config.unhandledProps = { ...config.unhandledProps, ...focusZoneDefinition.props }
config.unhandledProps.as = originalElementType
config.unhandledProps.isRtl = config.rtl
}
return render(config)
}
</p>