├── .gitignore ├── LICENSE ├── README.md ├── hooks.json └── site ├── .gitignore ├── README.md ├── gatsby-config.js ├── package.json ├── src ├── components │ ├── header.js │ ├── layout.css │ └── layout.js ├── images │ └── gatsby-icon.png └── pages │ ├── 404.js │ └── index.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Nik Graf 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Collection of React Hooks 2 | 3 | _Warning: Hooks are currently a React [RFC](https://github.com/reactjs/rfcs/pull/68) and **not ready for production**. Use at minimum `react@16.7.0-alpha.0` to use this package._ 4 | 5 | ## Website 6 | 7 | [https://nikgraf.github.io/react-hooks/](https://nikgraf.github.io/react-hooks/) 8 | 9 | ## Planned Features 10 | 11 | - Add Type System Info e.g. TypeScript, Flow, Reason 12 | - Add information from Github and NPM 13 | -------------------------------------------------------------------------------- /hooks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "useState", 4 | "tags": ["React Core", "State Management"], 5 | "repositoryUrl": "https://github.com/facebook/react", 6 | "importStatement": "import { useState } from \"react\";" 7 | }, 8 | { 9 | "name": "useReducer", 10 | "tags": ["React Core", "State Management"], 11 | "repositoryUrl": "https://github.com/facebook/react", 12 | "importStatement": "import { useReducer } from \"react\";" 13 | }, 14 | { 15 | "name": "useEffect", 16 | "tags": ["React Core"], 17 | "repositoryUrl": "https://github.com/facebook/react", 18 | "importStatement": "import { useEffect } from \"react\";" 19 | }, 20 | { 21 | "name": "useLayoutEffect", 22 | "tags": ["React Core"], 23 | "repositoryUrl": "https://github.com/facebook/react", 24 | "importStatement": "import { useLayoutEffect } from \"react\";" 25 | }, 26 | { 27 | "name": "useContext", 28 | "tags": ["React Core"], 29 | "repositoryUrl": "https://github.com/facebook/react", 30 | "importStatement": "import { useContext } from \"react\";" 31 | }, 32 | { 33 | "name": "useMemo", 34 | "tags": ["React Core"], 35 | "repositoryUrl": "https://github.com/facebook/react", 36 | "importStatement": "import { useMemo } from \"react\";" 37 | }, 38 | { 39 | "name": "useRef", 40 | "tags": ["React Core"], 41 | "repositoryUrl": "https://github.com/facebook/react", 42 | "importStatement": "import { useRef } from \"react\";" 43 | }, 44 | { 45 | "name": "useMutationEffect", 46 | "tags": ["React Core"], 47 | "repositoryUrl": "https://github.com/facebook/react", 48 | "importStatement": "import { useMutationEffect } from \"react\";" 49 | }, 50 | { 51 | "name": "useImperativeMethods", 52 | "tags": ["React Core"], 53 | "repositoryUrl": "https://github.com/facebook/react", 54 | "importStatement": "import { useImperativeMethods } from \"react\";" 55 | }, 56 | { 57 | "name": "useCallback", 58 | "tags": ["React Core"], 59 | "repositoryUrl": "https://github.com/facebook/react", 60 | "importStatement": "import { useCallback } from \"react\";" 61 | }, 62 | { 63 | "name": "useImmer", 64 | "tags": ["State Management"], 65 | "repositoryUrl": "https://github.com/mweststrate/use-immer", 66 | "importStatement": "import { useImmer } from \"use-immer\";" 67 | }, 68 | { 69 | "name": "useImmerReducer", 70 | "tags": ["State Management"], 71 | "repositoryUrl": "https://github.com/mweststrate/use-immer", 72 | "importStatement": "import { useImmerReducer } from \"use-immer\";" 73 | }, 74 | { 75 | "name": "useSpring", 76 | "tags": ["Animation"], 77 | "repositoryUrl": "https://github.com/drcmda/react-spring", 78 | "importStatement": "import { useSpring } from \"react-spring\";" 79 | }, 80 | { 81 | "name": "useWindowSize", 82 | "tags": ["Layout"], 83 | "repositoryUrl": "https://github.com/rehooks/window-size", 84 | "importStatement": "import useWindowSize from \"@rehooks/window-size\";" 85 | }, 86 | { 87 | "name": "useInputValue", 88 | "tags": ["State Management"], 89 | "repositoryUrl": "https://github.com/rehooks/input-value", 90 | "importStatement": "import useInputValue from \"@rehooks/input-value\";" 91 | }, 92 | { 93 | "name": "useDocumentVisibility", 94 | "tags": ["Layout"], 95 | "repositoryUrl": "https://github.com/rehooks/document-visibility", 96 | "importStatement": "import useWindowSize from \"@rehooks/document-visibility\";" 97 | }, 98 | { 99 | "name": "useComponentSize", 100 | "tags": ["Layout"], 101 | "repositoryUrl": "https://github.com/rehooks/component-size", 102 | "importStatement": "import useWindowSize from \"@rehooks/component-size\";" 103 | }, 104 | { 105 | "name": "useDocumentTitle", 106 | "tags": [], 107 | "repositoryUrl": "https://github.com/rehooks/document-title", 108 | "importStatement": "import useDocumentTitle from \"@rehooks/document-title\";" 109 | }, 110 | { 111 | "name": "useNetworkStatus", 112 | "tags": ["Network"], 113 | "repositoryUrl": "https://github.com/rehooks/network-status", 114 | "importStatement": "import useNetworkStatus from \"@rehooks/network-status\";" 115 | }, 116 | { 117 | "name": "useOnlineStatus", 118 | "tags": ["Network"], 119 | "repositoryUrl": "https://github.com/rehooks/online-status", 120 | "importStatement": "import useOnlineStatus from \"@rehooks/online-status\";" 121 | }, 122 | { 123 | "name": "useLocalStorage", 124 | "tags": [], 125 | "repositoryUrl": "https://github.com/rehooks/local-storage", 126 | "importStatement": "import useLocalStorage from \"@rehooks/local-storage\";" 127 | }, 128 | { 129 | "name": "useWindowScrollPosition", 130 | "tags": ["Layout"], 131 | "repositoryUrl": "https://github.com/rehooks/window-scroll-position", 132 | "importStatement": "import useWindowScrollPosition from \"@rehooks/window-scroll-position\";" 133 | }, 134 | { 135 | "name": "useDeviceMotion", 136 | "tags": [], 137 | "repositoryUrl": "https://github.com/palmerhq/the-platform", 138 | "importStatement": "import useDeviceMotion from \"the-platform\";" 139 | }, 140 | { 141 | "name": "useDeviceOrientation", 142 | "tags": [], 143 | "repositoryUrl": "https://github.com/palmerhq/the-platform", 144 | "importStatement": "import useDeviceOrientation from \"the-platform\";" 145 | }, 146 | { 147 | "name": "useGeoPosition", 148 | "tags": [], 149 | "repositoryUrl": "https://github.com/palmerhq/the-platform", 150 | "importStatement": "import useGeoPosition from \"the-platform\";" 151 | }, 152 | { 153 | "name": "useNetworkStatus", 154 | "tags": ["Network"], 155 | "repositoryUrl": "https://github.com/palmerhq/the-platform", 156 | "importStatement": "import useNetworkStatus from \"the-platform\";" 157 | }, 158 | { 159 | "name": "useMedia", 160 | "tags": [], 161 | "repositoryUrl": "https://github.com/palmerhq/the-platform", 162 | "importStatement": "import useMedia from \"the-platform\";" 163 | }, 164 | { 165 | "name": "useScript", 166 | "tags": [], 167 | "repositoryUrl": "https://github.com/palmerhq/the-platform", 168 | "importStatement": "import useScript from \"the-platform\";" 169 | }, 170 | { 171 | "name": "useStylesheet", 172 | "tags": [], 173 | "repositoryUrl": "https://github.com/palmerhq/the-platform", 174 | "importStatement": "import useStylesheet from \"the-platform\";" 175 | }, 176 | { 177 | "name": "useWindowScrollPosition", 178 | "tags": [], 179 | "repositoryUrl": "https://github.com/palmerhq/the-platform", 180 | "importStatement": "import useWindowScrollPosition from \"the-platform\";" 181 | }, 182 | { 183 | "name": "useWindowSize", 184 | "tags": ["Layout"], 185 | "repositoryUrl": "https://github.com/palmerhq/the-platform", 186 | "importStatement": "import useWindowSize from \"the-platform\";" 187 | }, 188 | { 189 | "name": "useStateful", 190 | "tags": ["State Management"], 191 | "repositoryUrl": "https://github.com/kitze/react-hanger", 192 | "importStatement": "import { useStateful } from \"react-hanger\";" 193 | }, 194 | { 195 | "name": "useOnMount", 196 | "tags": [], 197 | "repositoryUrl": "https://github.com/kitze/react-hanger", 198 | "importStatement": "import { useOnMount } from \"react-hanger\";" 199 | }, 200 | { 201 | "name": "useOnUnmount", 202 | "tags": [], 203 | "repositoryUrl": "https://github.com/kitze/react-hanger", 204 | "importStatement": "import { useOnUnmount } from \"react-hanger\";" 205 | }, 206 | { 207 | "name": "useLifecycleHooks", 208 | "tags": [], 209 | "repositoryUrl": "https://github.com/kitze/react-hanger", 210 | "importStatement": "import { useLifecycleHooks } from \"react-hanger\";" 211 | }, 212 | { 213 | "name": "useBoolean", 214 | "tags": ["State Management"], 215 | "repositoryUrl": "https://github.com/kitze/react-hanger", 216 | "importStatement": "import { useBoolean } from \"react-hanger\";" 217 | }, 218 | { 219 | "name": "useNumber", 220 | "tags": ["State Management"], 221 | "repositoryUrl": "https://github.com/kitze/react-hanger", 222 | "importStatement": "import { useNumber } from \"react-hanger\";" 223 | }, 224 | { 225 | "name": "useInput", 226 | "tags": ["State Management"], 227 | "repositoryUrl": "https://github.com/kitze/react-hanger", 228 | "importStatement": "import { useInput } from \"react-hanger\";" 229 | }, 230 | { 231 | "name": "useArray", 232 | "tags": ["State Management"], 233 | "repositoryUrl": "https://github.com/kitze/react-hanger", 234 | "importStatement": "import { useArray } from \"react-hanger\";" 235 | }, 236 | { 237 | "name": "useSetState", 238 | "tags": ["State Management"], 239 | "repositoryUrl": "https://github.com/kitze/react-hanger", 240 | "importStatement": "import { useSetState } from \"react-hanger\";" 241 | }, 242 | { 243 | "name": "usePrevious", 244 | "tags": ["State Management"], 245 | "repositoryUrl": "https://github.com/kitze/react-hanger", 246 | "importStatement": "import { usePrevious } from \"react-hanger\";" 247 | }, 248 | { 249 | "name": "useToggle", 250 | "tags": ["State Management"], 251 | "repositoryUrl": "https://github.com/kalcifer/react-powerhooks", 252 | "importStatement": "import { useToggle } from \"react-powerhooks\";" 253 | }, 254 | { 255 | "name": "useActive", 256 | "tags": [], 257 | "repositoryUrl": "https://github.com/kalcifer/react-powerhooks", 258 | "importStatement": "import { useActive } from \"react-powerhooks\";" 259 | }, 260 | { 261 | "name": "useInterval", 262 | "tags": ["Timing"], 263 | "repositoryUrl": "https://github.com/kalcifer/react-powerhooks", 264 | "importStatement": "import { useInterval } from \"react-powerhooks\";" 265 | }, 266 | { 267 | "name": "useBattery", 268 | "tags": ["Sensor", "Browser-API", "Battery"], 269 | "repositoryUrl": "https://github.com/streamich/react-use", 270 | "importStatement": "import { useBattery } from \"react-use\";" 271 | }, 272 | { 273 | "name": "useGeolocation", 274 | "tags": ["Sensor", "Browser-API", "Geo", "Location"], 275 | "repositoryUrl": "https://github.com/streamich/react-use", 276 | "importStatement": "import { useGeolocation } from \"react-use\";" 277 | }, 278 | { 279 | "name": "useHover", 280 | "tags": ["Sensor", "UI", "Mouse", "Hover"], 281 | "repositoryUrl": "https://github.com/streamich/react-use", 282 | "importStatement": "import { useHover } from \"react-use\";" 283 | }, 284 | { 285 | "name": "useIdle", 286 | "tags": ["Sensor", "Browser-API", "UI"], 287 | "repositoryUrl": "https://github.com/streamich/react-use", 288 | "importStatement": "import { useIdle } from \"react-use\";" 289 | }, 290 | { 291 | "name": "useLocation", 292 | "tags": ["Sensor", "Browser-API", "Location"], 293 | "repositoryUrl": "https://github.com/streamich/react-use", 294 | "importStatement": "import { useLocation } from \"react-use\";" 295 | }, 296 | { 297 | "name": "useMedia", 298 | "tags": ["Sensor", "Browser-API", "Media-Query", "CSS"], 299 | "repositoryUrl": "https://github.com/streamich/react-use", 300 | "importStatement": "import { useMedia } from \"react-use\";" 301 | }, 302 | { 303 | "name": "useMediaDevices", 304 | "tags": ["Sensor", "Browser-API", "Devices"], 305 | "repositoryUrl": "https://github.com/streamich/react-use", 306 | "importStatement": "import { useMediaDevices } from \"react-use\";" 307 | }, 308 | { 309 | "name": "useMotion", 310 | "tags": ["Sensor", "Browser-API", "Motion"], 311 | "repositoryUrl": "https://github.com/streamich/react-use", 312 | "importStatement": "import { useMotion } from \"react-use\";" 313 | }, 314 | { 315 | "name": "useNetwork", 316 | "tags": ["Sensor", "Browser-API", "Network"], 317 | "repositoryUrl": "https://github.com/streamich/react-use", 318 | "importStatement": "import { useNetwork } from \"react-use\";" 319 | }, 320 | { 321 | "name": "useOrientation", 322 | "tags": ["Sensor", "Browser-API", "Orientation"], 323 | "repositoryUrl": "https://github.com/streamich/react-use", 324 | "importStatement": "import { useOrientation } from \"react-use\";" 325 | }, 326 | { 327 | "name": "useSize", 328 | "tags": ["Sensor", "UI", "Size"], 329 | "repositoryUrl": "https://github.com/streamich/react-use", 330 | "importStatement": "import { useSize } from \"react-use\";" 331 | }, 332 | { 333 | "name": "useWindowSize", 334 | "tags": ["Sensor", "Browser-API", "UI", "Window", "Size"], 335 | "repositoryUrl": "https://github.com/streamich/react-use", 336 | "importStatement": "import { useWindowSize } from \"react-use\";" 337 | }, 338 | { 339 | "name": "useAudio", 340 | "tags": ["UI", "Audio"], 341 | "repositoryUrl": "https://github.com/streamich/react-use", 342 | "importStatement": "import { useAudio } from \"react-use\";" 343 | }, 344 | { 345 | "name": "useSpeech", 346 | "tags": ["UI", "Audio", "Speech"], 347 | "repositoryUrl": "https://github.com/streamich/react-use", 348 | "importStatement": "import { useSpeech } from \"react-use\";" 349 | }, 350 | { 351 | "name": "useRaf", 352 | "tags": ["Animations", "requestAnimationFrame", "Rendering"], 353 | "repositoryUrl": "https://github.com/streamich/react-use", 354 | "importStatement": "import { useRaf } from \"react-use\";" 355 | }, 356 | { 357 | "name": "useSpring", 358 | "tags": ["Animations", "Spring", "Tween"], 359 | "repositoryUrl": "https://github.com/streamich/react-use", 360 | "importStatement": "import { useSpring } from \"react-use\";" 361 | }, 362 | { 363 | "name": "useTimeout", 364 | "tags": ["Animations", "Timeout"], 365 | "repositoryUrl": "https://github.com/streamich/react-use", 366 | "importStatement": "import { useTimeout } from \"react-use\";" 367 | }, 368 | { 369 | "name": "useTween", 370 | "tags": ["Animations", "Tween"], 371 | "repositoryUrl": "https://github.com/streamich/react-use", 372 | "importStatement": "import { useTween } from \"react-use\";" 373 | }, 374 | { 375 | "name": "useAsync", 376 | "tags": ["Side-effect", "Async"], 377 | "repositoryUrl": "https://github.com/streamich/react-use", 378 | "importStatement": "import { useAsync } from \"react-use\";" 379 | }, 380 | { 381 | "name": "useCss", 382 | "tags": ["Side-effect", "UI", "CSS"], 383 | "repositoryUrl": "https://github.com/streamich/react-use", 384 | "importStatement": "import { useCss } from \"react-use\";" 385 | }, 386 | { 387 | "name": "useFavicon", 388 | "tags": ["Side-effect", "Favicon"], 389 | "repositoryUrl": "https://github.com/streamich/react-use", 390 | "importStatement": "import { useFavicon } from \"react-use\";" 391 | }, 392 | { 393 | "name": "useTitle", 394 | "tags": ["Side-effect", "Title"], 395 | "repositoryUrl": "https://github.com/streamich/react-use", 396 | "importStatement": "import { useTitle } from \"react-use\";" 397 | }, 398 | { 399 | "name": "useLifecycles", 400 | "tags": ["Lifecycles"], 401 | "repositoryUrl": "https://github.com/streamich/react-use", 402 | "importStatement": "import { useLifecycles } from \"react-use\";" 403 | }, 404 | { 405 | "name": "useLogger", 406 | "tags": ["Lifecycles"], 407 | "repositoryUrl": "https://github.com/streamich/react-use", 408 | "importStatement": "import { useLogger } from \"react-use\";" 409 | }, 410 | { 411 | "name": "useMount", 412 | "tags": ["Lifecycles"], 413 | "repositoryUrl": "https://github.com/streamich/react-use", 414 | "importStatement": "import { useMount } from \"react-use\";" 415 | }, 416 | { 417 | "name": "useUnmount", 418 | "tags": ["Lifecycles"], 419 | "repositoryUrl": "https://github.com/streamich/react-use", 420 | "importStatement": "import { useUnmount } from \"react-use\";" 421 | }, 422 | { 423 | "name": "useSetState", 424 | "tags": ["State"], 425 | "repositoryUrl": "https://github.com/streamich/react-use", 426 | "importStatement": "import { useSetState } from \"react-use\";" 427 | }, 428 | { 429 | "name": "useToggle", 430 | "tags": ["State"], 431 | "repositoryUrl": "https://github.com/streamich/react-use", 432 | "importStatement": "import { useToggle } from \"react-use\";" 433 | }, 434 | { 435 | "name": "useCounter", 436 | "tags": ["State"], 437 | "repositoryUrl": "https://github.com/streamich/react-use", 438 | "importStatement": "import { useCounter } from \"react-use\";" 439 | }, 440 | { 441 | "name": "useList", 442 | "tags": ["State"], 443 | "repositoryUrl": "https://github.com/streamich/react-use", 444 | "importStatement": "import { useList } from \"react-use\";" 445 | }, 446 | { 447 | "name": "useMap", 448 | "tags": ["State"], 449 | "repositoryUrl": "https://github.com/streamich/react-use", 450 | "importStatement": "import { useMap } from \"react-use\";" 451 | }, 452 | { 453 | "name": "useCallbag", 454 | "tags": ["Streams"], 455 | "repositoryUrl": "https://github.com/Andarist/use-callbag", 456 | "importStatement": "import useCallbag from \"use-callbag\";" 457 | }, 458 | { 459 | "name": "createSelector", 460 | "tags": [], 461 | "repositoryUrl": "https://github.com/Andarist/react-selector-hooks", 462 | "importStatement": "import { createSelector } from \"react-selector-hooks\";" 463 | }, 464 | { 465 | "name": "createStateSelector", 466 | "tags": [], 467 | "repositoryUrl": "https://github.com/Andarist/react-selector-hooks", 468 | "importStatement": "import { createStateSelector } from \"react-selector-hooks\";" 469 | }, 470 | { 471 | "name": "createStructuredSelector", 472 | "tags": [], 473 | "repositoryUrl": "https://github.com/Andarist/react-selector-hooks", 474 | "importStatement": "import { createStructuredSelector } from \"react-selector-hooks\";" 475 | }, 476 | { 477 | "name": "react-intersection-visible-hook", 478 | "tags": ["Viewport", "Visible"], 479 | "repositoryUrl": "https://github.com/AvraamMavridis/react-intersection-visible-hook", 480 | "importStatement": "import useIntersectionVisible from \"react-intersection-visible-hook\";" 481 | }, 482 | { 483 | "name": "react-window-communication-hook", 484 | "tags": ["Communication"], 485 | "repositoryUrl": "https://github.com/AvraamMavridis/react-window-communication-hook", 486 | "importStatement": "import useBrowserContextCommunication from \"react-window-communication-hook\";" 487 | }, 488 | { 489 | "name": "useSubstate", 490 | "tags": ["State Management"], 491 | "repositoryUrl": "https://github.com/philipp-spiess/use-substate", 492 | "importStatement": "import { SubstateProvider, useSubstate } from \"use-substate\";" 493 | }, 494 | { 495 | "name": "useOnClickOutside", 496 | "tags": ["Sensor", "Click", "UI", "Mouse", "Touch"], 497 | "repositoryUrl": "https://github.com/Andarist/use-onclickoutside", 498 | "importStatement": "import useOnClickOutside from \"use-onclickoutside\";" 499 | }, 500 | { 501 | "name": "usePrevious", 502 | "tags": [], 503 | "repositoryUrl": "https://github.com/Andarist/use-previous", 504 | "importStatement": "import usePrevious from \"use-previous\";" 505 | }, 506 | { 507 | "name": "react-hooks-global-state", 508 | "tags": ["State Management"], 509 | "repositoryUrl": "https://github.com/dai-shi/react-hooks-global-state", 510 | "importStatement": "import { createGlobalState } from \"react-hooks-global-state\";" 511 | }, 512 | { 513 | "name": "promise-hook", 514 | "tags": ["Network"], 515 | "repositoryUrl": "https://github.com/aiven715/promise-hook", 516 | "importStatement": "import { usePromise } from \"promise-hook\";" 517 | }, 518 | { 519 | "name": "useDomLocation", 520 | "tags": ["UI","Location"], 521 | "repositoryUrl": "https://github.com/forthealllight/dom-location", 522 | "importStatement": "import useDomLocation from \"dom-location\";" 523 | }, 524 | { 525 | "name": "useGraphqlRequest", 526 | "tags": ["graphQL","Network"], 527 | "repositoryUrl": "https://github.com/capaj/use-graphql-request", 528 | "importStatement": "import { setupClient } from \"use-graphql-request\"" 529 | }, 530 | { 531 | "name": "useObjectState", 532 | "tags": ["State Management"], 533 | "repositoryUrl": "https://github.com/thers/use-object-state", 534 | "importStatement": "import { useObjectState } from \"use-object-state\"" 535 | }, 536 | { 537 | "name": "useApolloClient", 538 | "tags": ["graphQL", "Network", "State Management"], 539 | "repositoryUrl": "https://github.com/trojanowski/react-apollo-hooks", 540 | "importStatement": "import { useApolloClient } from \"react-apollo-hooks\"" 541 | }, 542 | { 543 | "name": "useApolloMutation", 544 | "tags": ["graphQL", "Network", "State Management"], 545 | "repositoryUrl": "https://github.com/trojanowski/react-apollo-hooks", 546 | "importStatement": "import { useApolloMutation } from \"react-apollo-hooks\"" 547 | }, 548 | { 549 | "name": "useApolloQuery", 550 | "tags": ["graphQL", "Network", "State Management"], 551 | "repositoryUrl": "https://github.com/trojanowski/react-apollo-hooks", 552 | "importStatement": "import { useApolloQuery } from \"react-apollo-hooks\"" 553 | } 554 | ] 555 | -------------------------------------------------------------------------------- /site/.gitignore: -------------------------------------------------------------------------------- 1 | # Project dependencies 2 | .cache 3 | node_modules 4 | yarn-error.log 5 | 6 | # Build directory 7 | /public 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /site/README.md: -------------------------------------------------------------------------------- 1 | ## Install 2 | 3 | ``` 4 | yarn 5 | ``` 6 | 7 | ## Develop 8 | 9 | ``` 10 | yarn develop 11 | ``` -------------------------------------------------------------------------------- /site/gatsby-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | siteMetadata: { 3 | title: 'Collection of React Hooks', 4 | }, 5 | plugins: [ 6 | 'gatsby-plugin-styled-components', 7 | 'gatsby-plugin-react-helmet', 8 | ], 9 | pathPrefix: "/react-hooks", 10 | } 11 | -------------------------------------------------------------------------------- /site/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-hooks", 3 | "version": "1.0.0", 4 | "author": "Nik Graf", 5 | "dependencies": { 6 | "babel-plugin-styled-components": "^1.8.0", 7 | "gatsby": "^2.0.19", 8 | "gatsby-plugin-react-helmet": "^3.0.0", 9 | "gatsby-plugin-styled-components": "^3.0.0", 10 | "react": "^16.7.0-alpha.0", 11 | "react-dom": "^16.7.0-alpha.0", 12 | "react-helmet": "^5.2.0", 13 | "styled-components": "^4.0.2" 14 | }, 15 | "license": "MIT", 16 | "scripts": { 17 | "build": "gatsby build", 18 | "develop": "gatsby develop", 19 | "deploy": "gatsby build --prefix-paths && gh-pages -d public" 20 | }, 21 | "devDependencies": { 22 | "gh-pages": "^2.0.1", 23 | "prettier": "^1.14.2" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /site/src/components/header.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Link } from "gatsby"; 3 | 4 | const Header = ({ siteTitle }) => ( 5 |
You just hit a route that doesn't exist... the sadness.
8 |63 | Warning: Hooks are currently a React 64 | RFC and{" "} 65 | not ready for production. 66 |
67 |68 | You can add your hooks by opening a pull-request at{" "} 69 | 70 | https://github.com/nikgraf/react-hooks 71 | 72 | . 73 |
74 |
97 | {hook.importStatement}
98 |
99 |