Travis build: 291

This commit is contained in:
30secondsofcode
2020-03-10 08:25:24 +00:00
parent 5574466ee2
commit accea9b71c
2 changed files with 42 additions and 0 deletions

View File

@ -563,6 +563,22 @@
"hash": "82ef558fad661a522f5e897014b3898ad56ab6603a342c477f09edaa6281a0c9"
}
},
{
"id": "useComponentWillUnmount",
"type": "snippetListing",
"title": "useComponentWillUnmount",
"attributes": {
"text": "A hook that executes a callback immediately before a component is unmounted and destroyed.\n\n- Use `React.useEffect()` with an empty array as the second argument and return the provided callback to be executed only once before cleanup.\n\n",
"tags": [
"hooks",
"effect",
"beginner"
]
},
"meta": {
"hash": "dd2769c603f226996de8baf90af511fc788543dcb194a3b600f83fd2916699a6"
}
},
{
"id": "useFetch",
"type": "snippetListing",

View File

@ -903,6 +903,32 @@
"authorCount": 2
}
},
{
"id": "useComponentWillUnmount",
"title": "useComponentWillUnmount",
"type": "snippet",
"attributes": {
"fileName": "useComponentWillUnmount.md",
"text": "A hook that executes a callback immediately before a component is unmounted and destroyed.\n\n- Use `React.useEffect()` with an empty array as the second argument and return the provided callback to be executed only once before cleanup.\n\n",
"codeBlocks": {
"style": "",
"code": "const useComponentWillUnmount = onUnmountHandler => {\n React.useEffect(() => () => {\n onUnmountHandler()\n }, []);\n}",
"example": "const Unmounter = () => {\n useComponentWillUnmount(() => console.log('Component will unmount'));\n\n return <div>Check the console!</div>;\n}\n\nReactDOM.render(<Unmounter />, document.getElementById('root'));"
},
"tags": [
"hooks",
"effect",
"beginner"
]
},
"meta": {
"hash": "dd2769c603f226996de8baf90af511fc788543dcb194a3b600f83fd2916699a6",
"firstSeen": "1578060056",
"lastUpdated": "1578060056",
"updateCount": 2,
"authorCount": 2
}
},
{
"id": "useFetch",
"title": "useFetch",