https://github.com/mainick/react-hooks
Esempi con gli hooks di React
https://github.com/mainick/react-hooks
react react-hooks useeffect-hook usestate-hook
Last synced: 7 months ago
JSON representation
Esempi con gli hooks di React
- Host: GitHub
- URL: https://github.com/mainick/react-hooks
- Owner: mainick
- Created: 2020-11-19T08:21:30.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-22T09:41:34.000Z (almost 5 years ago)
- Last Synced: 2025-01-23T02:31:50.018Z (9 months ago)
- Topics: react, react-hooks, useeffect-hook, usestate-hook
- Language: JavaScript
- Homepage:
- Size: 215 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Esempi React Hooks
Gli Hooks ci consentono di utilizzare lo stato, gli "effetti collaterali" e altre funzionalità nei componenti funzionali.
Prima i componenti funzionali venivano chiamati componenti funzionali stateless (FSC), ovvero senza stato,
ora **grazie agli Hooks siamo in grado di usare lo stato e non è più necessario creare un componente di classe per utilizzarlo**.Qui troverete esempi per come utilizzare gli hooks più comuni:
- Hook State **useState**: AppHookState.js
- Hook Effect **useEffect**: AppHookEffect.jse come creare e utilizzare un hook personalizzato:
- Hook Custom **useFetch**: AppHookCustom.jsimportare il componente del relativo hook in *index.js* per vederlo in opera.
https://codesandbox.io/s/react-hooks-vcrku