Cheatography
https://cheatography.com
React Hooks Simples React Hooks Simples
Hooks
useState |
const [count, setCount] = useState(0);
|
useReducer |
const [todos, dispatch] = useReducer(todosReducer);
|
useFriendStatus |
const isOnline = useFriendStatus(props.friend.id);
|
|
|
react-hot-toast
|
|
|
toast.success('Successfully created!');
|
|
toast.error('This is an error!');
|
|
toast.custom(<div>Hello World</div>);
|
|
toast.loading('Waiting...');
|
|
|
|
|
toast
<Toaster position="top-center" reverseOrder={false} gutter={8} containerClassName="" containerStyle={{}} toastOptions={{ // Define default options className: '', duration: 5000, style: { background: '#363636', color: '#fff', }, // Default options for specific types success: { duration: 3000, theme: { primary: 'green', secondary: 'black', }, }, }} />
|
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets