Skip to content

Commit 5d6044e

Browse files
committed
update readme setState confetti_enabled by boolean
1 parent d2a494a commit 5d6044e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ then put the component inside render
7575
import package
7676

7777
```javascript
78-
import {Confetti, fetchConfettiFromFirebase} from '@hyperjumptech/react-native-confetti';
78+
import {
79+
Confetti,
80+
fetchConfettiFromFirebase,
81+
} from '@hyperjumptech/react-native-confetti';
7982
```
8083

8184
define state to hold the parameters
@@ -103,7 +106,14 @@ const keys = [
103106
'confetti_image_name',
104107
];
105108

106-
fetchConfetti(keys).then((confetti) => {
109+
fetchConfetti(keys).then((data) => {
110+
const confetti = {
111+
confetti_type: data.confetti_type,
112+
confetti_color: data.confetti_color,
113+
confetti_character: data.confetti_character,
114+
confetti_enabled: data.confetti_enabled === '1' ? true : false,
115+
confetti_image_name: data.confetti_image_name,
116+
};
107117
this.setState({confetti});
108118
});
109119
```
@@ -183,7 +193,6 @@ To test, run `npm run test` or `yarn test`
183193

184194
To see the running demo, you can run the example app with these steps:
185195

186-
187196
1. change directory to `example`
188197

189198
```

0 commit comments

Comments
 (0)