Skip to content

Commit 7a57b5b

Browse files
refactor: readme documentation
1 parent 8157bf3 commit 7a57b5b

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

README.MD

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ yarn add react-render-helper
2424

2525
## Usage
2626

27+
### without fallback
28+
2729
```
28-
import React from 'react';
30+
import React from "react"
2931
import { Show } from 'react-render-helper';
3032
3133
const App = () => {
@@ -40,3 +42,22 @@ const App = () => {
4042
);
4143
};
4244
```
45+
46+
### with fallback
47+
48+
```
49+
import React from "react"
50+
import { Show } from 'react-render-helper';
51+
52+
const App = () => {
53+
const showText = false;
54+
55+
return (
56+
<div>
57+
<Show when={showText} fallback={<h1>Oops...</h1>}>
58+
<h1>Hello World</h1>
59+
</Show>
60+
</div>
61+
);
62+
};
63+
```

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)