import React, { useEffect } from 'react'; const Alert = (props) => { //props.type == 'success' alert-success //props.type == 'danger' alert-danger useEffect( () => { let timer = setTimeout(()=>{ clearTimeout(timer); if(props.hide) props.hide(); }, 4000) },[]); return (