Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Alert = React.forwardRef((uncontrolledProps, ref) => {
const {
bsPrefix,
show,
closeLabel,
className,
children,
variant,
onClose,
dismissible,
transition: Transition,
...props
} = useControllable(uncontrolledProps, controllables);
const prefix = useBootstrapPrefix(bsPrefix, 'alert');
const handleClose = useEventCallback(e => {
onClose(false, e);
});
const alert = (
function BindingContext(
uncontrolledProps: Props
) {
let {
value: model,
onChange,
getter,
setter,
children,
}: Props = useUncontrolled(uncontrolledProps, { value: 'onChange' })
if (process.env.NODE_ENV !== 'production') {
setter = wrapSetter(setter!)
}
const updateBindingValue = useCallback(
(mapValue, args) => {
let paths: string[] = []
Object.keys(mapValue).forEach(key => {
let field = mapValue[key]
let value
if (typeof field === 'function') value = field(...args)
else if (field === '.' || field == null || args[0] == null)
value = args[0]