Update tags for all snippets

Resolves #92
This commit is contained in:
Angelos Chalaris
2020-03-16 12:50:44 +02:00
parent accea9b71c
commit ae78e6d456
30 changed files with 31 additions and 31 deletions

View File

@ -1,6 +1,6 @@
---
title: Alert
tags: visual,beginner,state,effect
tags: components,beginner,state,effect
---
Creates an alert component with `type` prop.
@ -9,7 +9,7 @@ Creates an alert component with `type` prop.
- Use the `React.setState()` hook to create the `isShown` and `isLeaving` state variables and set their values to `false`.
- Define `timeoutId` to keep the timer instance for clearing on component unmount.
- Use the `React.setEffect()` hook to update the value of `isShown` to `true` and clear interval by using `timeoutId` when component is unmounted.
- Define `closeNotification` function to set the component is removed from DOM by displaying fading out animation and set `isShown` to `false` via `setTimeout()`.
- Define `closeNotification` function to set the component is removed from DOM by displaying fading out animation and set `isShown` to `false` via `setTimeout()`.
- Define the component, which renders the alert component with user defined `message` and a close button to remove the component from DOM.
```css