correcting spelling mistakes

This commit is contained in:
Mike Rogers 2020-03-05 11:36:43 +00:00
parent 9a7facd668
commit e4eec7bf63
8 changed files with 8 additions and 8 deletions

View File

@ -1,3 +1,3 @@
# Lifecycle
*"Lifecycle Hooks"* modify and extend built-in React hooks or immitate React Class component lifecycle patterns.
*"Lifecycle Hooks"* modify and extend built-in React hooks or imitate React Class component lifecycle patterns.

View File

@ -1,6 +1,6 @@
# `createReducer`
Factory for reducer hooks with custom middleware with an identical API as [React's `useReducer`](https://reactjs.org/docs/hooks-reference.html#usereducer). Compatible with [Redux middlware](https://redux.js.org/advanced/middleware).
Factory for reducer hooks with custom middleware with an identical API as [React's `useReducer`](https://reactjs.org/docs/hooks-reference.html#usereducer). Compatible with [Redux middleware](https://redux.js.org/advanced/middleware).
## Usage

View File

@ -28,5 +28,5 @@ const [{value, error, noUserInteraction}, copyToClipboard] = useCopyToClipboard(
```
- `value` — value that was copied to clipboard, undefined when nothing was copied.
- `error` — catched error when trying to copy to clipboard.
- `error` — caught error when trying to copy to clipboard.
- `noUserInteraction` — boolean indicating if user interaction was required to copy the value to clipboard to expose full API from underlying [`copy-to-clipboard`](https://github.com/sudodoki/copy-to-clipboard) library.

View File

@ -1,6 +1,6 @@
# `useKeyPressEvent`
This hook fires `keydown` and `keyup` calllbacks, similar to how [`useKey`](./useKey.md)
This hook fires `keydown` and `keyup` callbacks, similar to how [`useKey`](./useKey.md)
hook does, but it only triggers each callback once per press cycle. For example,
if you press and hold a key, it will fire `keydown` callback only once.

View File

@ -50,6 +50,6 @@ const [validity, revalidate] = useStateValidator(
- **`validity`**_`: [boolean|null, ...any[]]`_ result of validity check. First element is strictly nullable boolean, but others can contain arbitrary data;
- **`revalidate`**_`: ()=>void`_ runs validator once again
- **`validator`**_`: (state, setValidity?)=>[boolean|null, ...any[]]`_ should return an array suitable for validity state described above;
- `states` - current states values as the've been passed to the hook;
- `states` - current states values as they've been passed to the hook;
- `setValidity` - if defined hook will not trigger validity change automatically. Useful for async validators;
- `initialValidity` - validity value which set when validity is nt calculated yet;

View File

@ -1,6 +1,6 @@
# `useRendersCount`
Tracks compontent's renders count including the first render.
Tracks component's renders count including the first render.
## Usage

View File

@ -41,7 +41,7 @@ const Demo = () => {
const { state, currentIndex, prev, next, setStateAt, setState } = useStateList<T>(stateSet: T[] = []);
```
If `stateSet` changed, became shorter than before and `currentIndex` left in shrinked gap - the last element of list will be taken as current.
If `stateSet` changed, became shorter than before and `currentIndex` left in shrunk gap - the last element of list will be taken as current.
- **`state`**_`: T`_ &mdash; current state value;
- **`currentIndex`**_`: number`_ &mdash; current state index;

View File

@ -34,7 +34,7 @@ it('should return initialValue if localStorage empty and set that to localStorag
expect(localStorage.__STORE__[key]).toBe(`"${value}"`);
});
it('should return the value from localStorage if exists even if initialValue provied', () => {
it('should return the value from localStorage if exists even if initialValue provided', () => {
const key = 'some_key';
localStorage.setItem(key, STRINGIFIED_VALUE);