Skip to content

Commit

Permalink
fix(readme): fixed headers for usage
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Sep 26, 2021
1 parent 5b8b1e1 commit 188f859
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const Example = () => {

**_Note: For a fully auto-generated API, see [the github pages website](https://romac.github.io/react-if)_**

### <If />;
### &lt;If /&gt;

| Property | Type | Default |
| ----------- | --------------- | ------- |
Expand All @@ -203,35 +203,35 @@ The parameters of this render function are:

If the `keepAlive` prop evaluates to `false`, each rerender of the `<If />` component will automatically ignore the previous Promise if it was still pending.

### <Then />;
### &lt;Then /&gt;

Can contain any number of elements inside, which it renders as-is. It can also contain a function. Should not be used outside of an `<If />` block. It will only be displayed, if parent `If` block's condition is true.

### <Else />;
### &lt;Else /&gt;

Can contain any number of elements inside, which it renders as-is. It can also contain a function. Should not be used outside of an `<If />` block. It will only be displayed, if parent `If` block's condition is false.

### <Switch />;
### &lt;Switch /&gt;

A container for `<Case condition={...}/>` and `<Default />` blocks. It will render **the first matching** `Case`, or **the first encountered** `Default` (, or null).

### <Case />;
### &lt;Case /&gt;

| Property | Type |
| ----------- | ------- |
| `condition` | Boolean |

If the `Case` is the first one to have its `condition` evaluates to `true` inside the parent `<Switch />` it will be the only rendered.

### <Default />;
### &lt;Default /&gt;

If no `Case` have its `condition` evaluates to `true` inside the parent `<Switch />`, the first `Default` will be the only one rendered.

### <When />;
### &lt;When /&gt;

A shorthand for `<If condition={...}><Then>...</Then></If>`. The same rules apply to the child elements as with using the `Then` block.

### <Unless />;
### &lt;Unless /&gt;

A shorthand for `<If condition={...}><Else>...</Else></If>`. The same rules apply to the child elements as with using the `Else` block.

Expand Down

0 comments on commit 188f859

Please sign in to comment.