May 14th, 2017
Great ToastContext means great project!
Rich Text!
This is simple wall of text
import React from 'react'; | |
import AppNavigation from './AppNavigation'; | |
import {ToastProvider} from './ToastContext'; | |
import Toast from './Toast'; | |
const App = () => ( | |
<ToastProvider> | |
<Toast /> | |
<AppNavigation /> | |
</ToastProvider> | |
); | |
export default App; |
useEffect(() => { | |
if (toast.visible) { | |
timeout.current = setTimeout(hide, 1500); | |
return () => { | |
if (timeout.current) { | |
clearTimeout(timeout.current); | |
} | |
}; | |
} | |
}, [hide, toast]); |
This is a new way to rule a world:
I'm Napoleon