Skip to content

Commit

Permalink
Update docs 📖
Browse files Browse the repository at this point in the history
  • Loading branch information
paol-imi committed May 23, 2020
1 parent 0212333 commit bba1c23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions website/docs/tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,19 @@ A method to generate a ParentFiber instance.
| ------------- | ------------------------- |
| _ParentFiber_ | The parentFiber instance. |

### useParent( [findFiber] ): [parent, ref] ⚙️
### useParent( ref, [findFiber] ): parent ⚙️

An hook to generate a ParentFiber instance.

#### arguments

| Name | Type | Description |
| --------- | ------ | ------------------------------------------------------------------------------------------ |
| findFiber | _func_ | A function to change the parent fiber. <br/><br/> **Signature** `(parent: fiber) => fiber` |
| Name | Type | Description |
| --------- | ----------------- | ------------------------------------------------------------------------------------------ |
| ref | _React.RefObject_ | The ref of the parent element. <br/><br/> **Required** |
| findFiber | _func_ | A function to change the parent fiber. <br/><br/> **Signature** `(parent: fiber) => fiber` |

#### returns

| Type | Description |
| ------------------------------------------ | --------------------------------------------- |
| [_ParentFiber_, _React.ref<HTMLElement\>_] | The ParentFiber instance and the element ref. |
| Type | Description |
| ------------- | ------------------------- |
| _ParentFiber_ | The ParentFiber instance. |
3 changes: 2 additions & 1 deletion website/docs/useparent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ You can generate a parent instance to use the `send` method within a function co

```jsx
const Parent = ({children}) => {
const [parent, ref] = useParent();
const ref = useRef();
const parent = useParent(ref);

return (
<div className="parent" ref={ref}>
Expand Down

0 comments on commit bba1c23

Please sign in to comment.