Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/latviancoder/hooks-by-example
Collection of beginner-friendly real world examples of hook usage.
https://github.com/latviancoder/hooks-by-example
Last synced: about 2 months ago
JSON representation
Collection of beginner-friendly real world examples of hook usage.
- Host: GitHub
- URL: https://github.com/latviancoder/hooks-by-example
- Owner: latviancoder
- Created: 2018-11-03T08:44:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-31T17:51:16.000Z (about 5 years ago)
- Last Synced: 2024-08-01T02:25:18.191Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 141 KB
- Stars: 137
- Watchers: 2
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-awesome-react-hooks - hooks-by-example - friendly real world examples of hook usage. (Catalogs)
- awesome-react-hooks-cn - hooks-by-example - friendly real world examples of hook usage. (合集)
- awesome-react-hooks - hooks-by-example - friendly real world examples of hook usage. (Catalogs)
- awesome-react-hooks - hooks-by-example - friendly real world examples of hook usage. (Catalogs)
README
Hooks. People love them, people hate them. But one is for sure - hooks are there to stay and React ecosystem is going to evolve, again.
The most important feature of hooks is sharing _reusable functionality_. In the past it was achieved using _mixins_, which were later deprecated in favor of patterns like _render props_ and _higher order components_. But these patterns introduced additional complexity and resulted in something now called _wrapper hell_.
## What is this?
The purpose of this reposity is to provide beginner-friendly real-world examples of different hooks usage. Here are some of them:
* Accordion [[code](src/components/accordion), [demo](https://hooks-by-example.now.sh/accordion)]
* Todo list [[code](src/components/todo-list), [demo](https://hooks-by-example.now.sh/todo-list)]
* Form validation library [[code](src/components/form-library), [demo](https://hooks-by-example.now.sh/form-library)]
* Sortable [[code](src/components/sortable), [demo](https://hooks-by-example.now.sh/sortable)]
* Concurrent React experimentsThis application is built using `create-react-app`, so feel free to clone the repo and play with examples yourself.
```
yarn install
yarn start
```
## TodoMore examples, more comments. Pull requests and overall suggestions are welcome.