Skip to content

Commit

Permalink
chore(docs): Update changelog and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
imbhargav5 committed Jul 31, 2021
1 parent 8a68faf commit a7731cc
Show file tree
Hide file tree
Showing 75 changed files with 5,341 additions and 3 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## <small>5.4.3 (2021-07-31)</small>

* fix(useOutsideClickRef): fix child update logic and event listener phase (#534) ([8a68faf](https://github.com/imbhargav5/rooks/commit/8a68faf)), closes [#534](https://github.com/imbhargav5/rooks/issues/534)
* chore(docs): Update changelog and docs ([2a25edc](https://github.com/imbhargav5/rooks/commit/2a25edc))
* chore(docs): update sidebar and helpers (#537) ([be40993](https://github.com/imbhargav5/rooks/commit/be40993)), closes [#537](https://github.com/imbhargav5/rooks/issues/537)
* build(tsconfig): include .tsx files in tsconfig (#536) ([10d4b7b](https://github.com/imbhargav5/rooks/commit/10d4b7b)), closes [#536](https://github.com/imbhargav5/rooks/issues/536)
* contrib-readme-action has updated readme ([3e0af80](https://github.com/imbhargav5/rooks/commit/3e0af80))
* contrib-readme-action has updated readme ([173877d](https://github.com/imbhargav5/rooks/commit/173877d))
* docs: add redirects for old links (#527) ([ae7659a](https://github.com/imbhargav5/rooks/commit/ae7659a)), closes [#527](https://github.com/imbhargav5/rooks/issues/527)
* docs(useThrottle): update useThrottle example and sandbox (#514) ([9c469db](https://github.com/imbhargav5/rooks/commit/9c469db)), closes [#514](https://github.com/imbhargav5/rooks/issues/514)



## <small>5.4.2 (2021-07-25)</small>

* fix(pkg): add more details to package.json (#522) ([440519f](https://github.com/imbhargav5/rooks/commit/440519f)), closes [#522](https://github.com/imbhargav5/rooks/issues/522)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rooks",
"version": "5.4.2",
"version": "5.4.3",
"description": "Useful React hooks for everyone.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
7 changes: 5 additions & 2 deletions sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
{
"label": "Quick Start",
"collapsed": false,
"items": ["getting-started", "motivation"],
"items": [
"getting-started",
"motivation"
],
"type": "category"
},
{
Expand Down Expand Up @@ -82,4 +85,4 @@
"label": "Hooks List"
}
]
}
}
35 changes: 35 additions & 0 deletions versioned_docs/version-5.4.3/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
id: getting-started
title: Getting Started
sidebar_label: Getting Started
---

<!---->

### Installation

npm i - s rooks

### Importing the hooks

Import any hook from "rooks" and start using them!

```jsx
import { useDidMount } from 'rooks';
```

### Usage

```jsx
function App() {
useDidMount(() => {
alert('mounted');
});
return (
<div className="App">
<h1>Hello CodeSandbox</h1>
<h2>Start editing to see some magic happen!</h2>
</div>
);
}
```
12 changes: 12 additions & 0 deletions versioned_docs/version-5.4.3/home-sandbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<iframe src="https://codesandbox.io/embed/dawn-bush-z4kgg?fontsize=18&hidenavigation=1&module=%2Fsrc%2FRooks.js&theme=dark&editorsize=60"
style={{
width: "100%",
height: 500,
border: 0,
borderRadius: 4,
overflow: "hidden"
}}
title="dawn-bush-z4kgg"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>
73 changes: 73 additions & 0 deletions versioned_docs/version-5.4.3/list-of-hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
id: hooks-list
title: List of Hooks
sidebar_label: Hooks List
---

<!--hookslist start-->

* [useBoundingclientrect](https://react-hooks.org/docs/useBoundingclientrect) - getBoundingClientRect hook for React.
* [useBoundingclientrectRef](https://react-hooks.org/docs/useBoundingclientrectRef) - A hook that tracks the boundingclientrect of an element. It returns a callbackRef so that the element node if changed is easily tracked.
* [useCountdown](https://react-hooks.org/docs/useCountdown) - Count down to a target timestamp and call callbacks every second (or provided peried)
* [useCounter](https://react-hooks.org/docs/useCounter) - Counter hook for React.
* [useDebounce](https://react-hooks.org/docs/useDebounce) - Debounce hook for react
* [useDidMount](https://react-hooks.org/docs/useDidMount) - componentDidMount hook for React
* [useDidUpdate](https://react-hooks.org/docs/useDidUpdate) - componentDidUpdate hook for react
* [useDimensionsRef](https://react-hooks.org/docs/useDimensionsRef) - Easily grab dimensions of an element with a ref using this hook
* [useDocumentEventListener](https://react-hooks.org/docs/useDocumentEventListener) - A react hook to an event listener to the document object
* [useEffectOnceWhen](https://react-hooks.org/docs/useEffectOnceWhen) - Runs a callback effect atmost one time when a condition becomes true
* [useEventListenerRef](https://react-hooks.org/docs/useEventListenerRef) - A react hook to add an event listener to a ref
* [useForkRef](https://react-hooks.org/docs/useForkRef) - A hook that can combine two refs(mutable or callbackRefs) into a single callbackRef
* [useFreshRef](https://react-hooks.org/docs/useFreshRef) - Avoid stale state in callbacks with this hook. Auto updates values using a ref.
* [useFreshTick](https://react-hooks.org/docs/useFreshTick) - Like use-fresh-ref but specifically for functions
* [useFullscreen](https://react-hooks.org/docs/useFullscreen) - Use full screen api for making beautiful and emersive experinces.
* [useGeolocation](https://react-hooks.org/docs/useGeolocation) - A hook to provide the geolocation info on client side.
* [useInViewRef](https://react-hooks.org/docs/useInViewRef) - Simple hook that monitors element enters or leave the viewport that's using Intersection Observer API.
* [useInput](https://react-hooks.org/docs/useInput) - Input hook for React.
* [useIntersectionObserverRef](https://react-hooks.org/docs/useIntersectionObserverRef) - A hook to register an intersection observer listener.
* [useInterval](https://react-hooks.org/docs/useInterval) - setInterval hook for React.
* [useIntervalWhen](https://react-hooks.org/docs/useIntervalWhen) - Sets an interval immediately when a condition is true
* [useIsomorphicEffect](https://react-hooks.org/docs/useIsomorphicEffect) - A hook that resolves to useEffect on the server and useLayoutEffect on the client.
* [useKey](https://react-hooks.org/docs/useKey) - keypress, keyup and keydown event handlers as hooks for react.
* [useKeyBindings](https://react-hooks.org/docs/useKeyBindings) - useKeyBindings can bind multiple keys to multiple callbacks and fire the callbacks on key press.
* [useKeyRef](https://react-hooks.org/docs/useKeyRef) - Very similar useKey but it returns a ref
* [useKeys](https://react-hooks.org/docs/useKeys) - A hook which allows to setup callbacks when a combination of keys are pressed at the same time.
* [useLifecycleLogger](https://react-hooks.org/docs/useLifecycleLogger) - A react hook that console logs parameters as component transitions through lifecycles.
* [useLocalstorage](https://react-hooks.org/docs/useLocalstorage) - Localstorage hook for React. Syncs with localstorage values across components and browser windows automatically. Sets and retrieves a key from localStorage and subscribes to it for updates across windows.
* [useLocalstorageState](https://react-hooks.org/docs/useLocalstorageState) - UseState but auto updates values to localStorage
* [useMapState](https://react-hooks.org/docs/useMapState) - A react hook to manage state in a key value pair map.
* [useMediaMatch](https://react-hooks.org/docs/useMediaMatch) - Signal whether or not a media query is currently matched.
* [useMergeRefs](https://react-hooks.org/docs/useMergeRefs) - Merges any number of refs into a single ref
* [useMouse](https://react-hooks.org/docs/useMouse) - Mouse position hook for React.
* [useMultiSelectableList](https://react-hooks.org/docs/useMultiSelectableList) - A custom hook to easily select multiple values from a list
* [useMutationObserver](https://react-hooks.org/docs/useMutationObserver) - Mutation Observer hook for React.
* [useMutationObserverRef](https://react-hooks.org/docs/useMutationObserverRef) - A hook that tracks mutations of an element. It returns a callbackRef.
* [useNavigatorLanguage](https://react-hooks.org/docs/useNavigatorLanguage) - Navigator Language hook for React.
* [useOnWindowResize](https://react-hooks.org/docs/useOnWindowResize) - A React hook for adding an event listener for window resize
* [useOnWindowScroll](https://react-hooks.org/docs/useOnWindowScroll) - A React hook for adding an event listener for window scroll
* [useOnline](https://react-hooks.org/docs/useOnline) - Online status hook for React.
* [useOutsideClick](https://react-hooks.org/docs/useOutsideClick) - Outside click(for a ref) event as hook for React.
* [useOutsideClickRef](https://react-hooks.org/docs/useOutsideClickRef) - A hook that can track a click event outside a ref. Returns a callbackRef.
* [usePrevious](https://react-hooks.org/docs/usePrevious) - Access the previous value of a variable with this React hook
* [usePreviousDifferent](https://react-hooks.org/docs/usePreviousDifferent) - usePreviousDifferent returns the last different value of a variable
* [usePreviousImmediate](https://react-hooks.org/docs/usePreviousImmediate) - usePreviousImmediate returns the previous value of a variable even if it was the same or different
* [useQueueState](https://react-hooks.org/docs/useQueueState) - A React hook that manages state in the form of a queue
* [useRaf](https://react-hooks.org/docs/useRaf) - A continuously running requestAnimationFrame hook for React
* [useSelect](https://react-hooks.org/docs/useSelect) - Select values from a list easily. List selection hook for react.
* [useSelectableList](https://react-hooks.org/docs/useSelectableList) - Easily select a single value from a list of values. very useful for radio buttons, select inputs etc.
* [useSessionstorage](https://react-hooks.org/docs/useSessionstorage) - Session storage react hook. Easily manage session storage values.
* [useSessionstorageState](https://react-hooks.org/docs/useSessionstorageState) - useState but syncs with sessionstorage
* [useStackState](https://react-hooks.org/docs/useStackState) - A React hook that manages state in the form of a stack
* [useThrottle](https://react-hooks.org/docs/useThrottle) - Throttle custom hook for React
* [useTimeout](https://react-hooks.org/docs/useTimeout) - setTimeout hook for react.
* [useTimeoutWhen](https://react-hooks.org/docs/useTimeoutWhen) - Takes a callback and fires it when a condition is true
* [useToggle](https://react-hooks.org/docs/useToggle) - Toggle (between booleans or custom data)hook for React.
* [useUndoState](https://react-hooks.org/docs/useUndoState) - Drop in replacement for useState hook but with undo functionality.
* [useUpdateEffect](https://react-hooks.org/docs/useUpdateEffect) - An useEffect that does not run on first render
* [useVisibilitySensor](https://react-hooks.org/docs/useVisibilitySensor) - Visibility sensor hook for React.
* [useWillUnmount](https://react-hooks.org/docs/useWillUnmount) - componentWillUnmount lifecycle as hook for React.
* [useWindowEventListener](https://react-hooks.org/docs/useWindowEventListener) - Adds an event listener to window
* [useWindowScrollPosition](https://react-hooks.org/docs/useWindowScrollPosition) - A React hook to get the scroll position of the window
* [useWindowSize](https://react-hooks.org/docs/useWindowSize) - Window size hook for React.

<!--hookslist end-->
13 changes: 13 additions & 0 deletions versioned_docs/version-5.4.3/motivation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
id: motivation
title: Motivation
sidebar_label: Motivation
---

When custom hooks were released by the **React.js** team, I was overwhelmed with excitement watching them show the amount of customization that can now be done with custom hooks.

So that was a day I immediately decided to build **Rooks as a collection of custom hooks** that I would use for my projects regularly as a freelancer, or as a developer at my day.

I would use so many components which use the same behaviour over and over again. And I would keep asking myself if there was a better way of composing this behaviour so that I don't have to write the same code over and over again.

**Building a drop down, a model, or a form etec are all repetitive activities** that we as developers do on a day to day basis, and Rooks is an attempt to help you quickly build components as quickly as you can. I hope this proves as useful to you as it is to me.
Loading

0 comments on commit a7731cc

Please sign in to comment.