Travis build: 216

This commit is contained in:
30secondsofcode
2020-01-03 13:57:59 +00:00
parent 36a9640407
commit 4ebe525fce
2 changed files with 42 additions and 0 deletions

View File

@ -530,6 +530,22 @@
"hash": "e565a610582386df7a41cbcfcd2d2ad7df11651adceafdd9e4840ca2b756af21" "hash": "e565a610582386df7a41cbcfcd2d2ad7df11651adceafdd9e4840ca2b756af21"
} }
}, },
{
"id": "useComponentDidMount",
"type": "snippetListing",
"title": "useComponentDidMount",
"attributes": {
"text": "A hook that executes a callback immediately after a component is mounted.\n\n- Use `React.useEffect()` with an empty array as the second argument to execute the provided callback only once when the component is mounted.\n\n",
"tags": [
"hooks",
"effect",
"beginner"
]
},
"meta": {
"hash": "82ef558fad661a522f5e897014b3898ad56ab6603a342c477f09edaa6281a0c9"
}
},
{ {
"id": "useFetch", "id": "useFetch",
"type": "snippetListing", "type": "snippetListing",

View File

@ -850,6 +850,32 @@
"authorCount": 2 "authorCount": 2
} }
}, },
{
"id": "useComponentDidMount",
"title": "useComponentDidMount",
"type": "snippet",
"attributes": {
"fileName": "useComponentDidMount.md",
"text": "A hook that executes a callback immediately after a component is mounted.\n\n- Use `React.useEffect()` with an empty array as the second argument to execute the provided callback only once when the component is mounted.\n\n",
"codeBlocks": {
"style": "",
"code": "const useComponentDidMount = onMountHandler => {\n React.useEffect(() => {\n onMountHandler()\n }, []);\n}",
"example": "const Mounter = () => {\n useComponentDidMount(() => console.log('Component did mount'));\n\n return <div>Check the console!</div>;\n}\n\nReactDOM.render(<Mounter />, document.getElementById('root'));"
},
"tags": [
"hooks",
"effect",
"beginner"
]
},
"meta": {
"hash": "82ef558fad661a522f5e897014b3898ad56ab6603a342c477f09edaa6281a0c9",
"firstSeen": "1578059814",
"lastUpdated": "1578059814",
"updateCount": 2,
"authorCount": 2
}
},
{ {
"id": "useFetch", "id": "useFetch",
"title": "useFetch", "title": "useFetch",