You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 2, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
-41Lines changed: 0 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -117,47 +117,6 @@ import { Switch } from 'react-semantic-render'
117
117
</Switch>
118
118
```
119
119
120
-
### ShowIfElse
121
-
122
-
Renders content from if when condition equals true, else renders content from else.
123
-
124
-
| Property | Type | Description
125
-
|---|---|---|
126
-
| `condition` | boolean | Conditional statement
127
-
| `if` | function | Renders when condition is true
128
-
| `else` | function | Renders when condition is false
129
-
130
-
```jsx
131
-
import { ShowIfElse } from'react-semantic-render'
132
-
133
-
<ShowIfElse
134
-
condition={true}
135
-
if={() => (
136
-
<button>Render me!</button>
137
-
)}
138
-
else={() => (
139
-
<button>No, render me!</button>
140
-
)}
141
-
/>
142
-
```
143
-
144
-
### Hideable
145
-
146
-
Higher order component that injects 'hide' prop into specified component.
147
-
148
-
| Property | Type | Description
149
-
|---|---|---|
150
-
| `hide` | boolean | Conditional statement
151
-
152
-
```jsx
153
-
import { Hideable } from'react-semantic-render'
154
-
import { Button } from'./components'
155
-
156
-
constHideableButton=Hideable(Button)
157
-
158
-
<HideableButton hide={true} label="Click me!"/>
159
-
```
160
-
161
120
## Why
162
121
163
122
In the example below you see two very common use cases where you have to render something when a condition is true and render content from an array of data.
0 commit comments