react-hooks-introduction
react-hooks-introduction copied to clipboard
Introduction to React Hooks for function components (released in React 16.7.)
Something like this? ``` useEffect(() => { const cancelTokenSource = axios.CancelToken.source(); const fetchData = async () => { dispatch({ type: 'FETCH_INIT' }); try { const result = await await axios(url,...
## The dependency [react-scripts](https://github.com/facebook/create-react-app) was updated from `3.0.0` to `3.0.1`. π¨ [View failing branch](https://github.com/the-road-to-learn-react/react-hooks-introduction/compare/master...the-road-to-learn-react:greenkeeper%2Freact-scripts-3.0.1). This version is **covered** by your **current version range** and after updating it in your project...
Before ```jsx const useDataApi = (initialUrl, initialData) => { const [url, setUrl] = useState(initialUrl); const [state, dispatch] = useReducer(dataFetchReducer, { isLoading: false, isError: false, data: initialData, }); ... } ```...
## The dependency [axios](https://github.com/axios/axios) was updated from `0.18.0` to `0.19.0`. This version is **not covered** by your **current version range**. If you donβt accept this pull request, your project will...
## The dependency [use-data-api](https://github.com/the-road-to-learn-react/use-custom-element) was updated from `1.0.0` to `1.0.1`. π¨ [View failing branch](https://github.com/the-road-to-learn-react/react-hooks-introduction/compare/master...the-road-to-learn-react:greenkeeper%2Fuse-data-api-1.0.1). This version is **covered** by your **current version range** and after updating it in your project...