tannerlinsley / Use React Hooks
Use hooks in classes in React 16.5+
Stars: β 78
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Use React Hooks
Aspects
Delightful, simple library for aspect oriented programming in Objective-C and Swift.
Stars: β 8,255 (+10483.33%)
Mutual labels: hooks
React Redux Hooks Starter
React-redux boilerplate using hooks π£
Stars: β 69 (-11.54%)
Mutual labels: hooks
React Antd Multi Tabs Admin
ts+react+antd-ε€ι‘΅ηΎεε°ζ¨‘ζΏ(ηΊ―εηοΌι antd proοΌ)
Stars: β 73 (-6.41%)
Mutual labels: hooks
Use Firebase Auth
A custom React Hook that provides a declarative interface for Firebase Auth.
Stars: β 61 (-21.79%)
Mutual labels: hooks
Jsonapi React
A minimal JSON:API client and React hooks for fetching, updating, and caching remote data.
Stars: β 65 (-16.67%)
Mutual labels: hooks
Fontmod
Simple hook tool to change Win32 program font.
Stars: β 1,064 (+1264.1%)
Mutual labels: hooks
Urmem
[x86] Simple C++11 header-only cross-platform memhack library (hooks, patches, pointers, sig scan)
Stars: β 76 (-2.56%)
Mutual labels: hooks
Skeleton
A ready-to-use CodeIgniter skeleton with tons of new features and a whole new concept of hooks (actions and filters) as well as a ready-to-use and application-free themes and plugins system. Facebook Page: http://bit.ly/2oHzpxC | Facebook Group: http://bit.ly/2o3KOrA. Help me carry on making more free stuff β http://bit.ly/2ppNujE β
Stars: β 74 (-5.13%)
Mutual labels: hooks
E Commerce App React Native
E-commerce App UI. React native, Expo managed flow, React navigation v5, Notification.
Stars: β 61 (-21.79%)
Mutual labels: hooks
One Time Callbacks
Enable WordPress actions and filter callbacks to be called exactly once.
Stars: β 59 (-24.36%)
Mutual labels: hooks
Pcsgolh
PCSGOLH - Pointless Counter-Strike: Global Offensive Lua Hooks. A open-source Lua API for CS:GO hacking written in modern C++
Stars: β 56 (-28.21%)
Mutual labels: hooks
Hookrouter
The flexible, and fast router for react that is entirely based on hooks
Stars: β 1,200 (+1438.46%)
Mutual labels: hooks
use-react-hooks
use-react-hooks
adds support for hooks in React v16.6!
- βοΈ Tiny (3kb and 200 LOC)
- β Safely reverse-engineered using class lifecycles
- π Provides a clean and clear upgrade path to 16.7 when ready.
Demos
Install
npm install --save use-react-hooks
# or
yarn add use-react-hooks
Usage
To use hooks in a functional compoennt, wrap it in useHooks
then use any hook you want!
import React from "react";
import { useHooks, useState } from "use-react-hooks";
const App = useHooks(props => {
const [count, setCount] = useState(0);
return (
<div>
Count: {count}
<button onClick={() => setCount(old => old + 1)}>Increment</button>
</div>
);
});
Documentation
The following hooks are available as named exports from the use-react-hooks
package and follow the official React Hooks API here: https://reactjs.org/docs/hooks-reference.html
useReducer
useState
useContext
useMemo
useCallback
useEffect
useRef
useImperativeMethods
-
useMutationEffect
Note: currently identical touseEffect
-
useLayoutEffect
Note: currently identical touseEffect
Additional Hooks
The following hooks are also provided for convenience:
-
usePrevious
- Returns the previously rendered value you pass it
License
MIT Β© tannerlinsley
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].