Skip to content

Commit

Permalink
feat: managing notifications from within custom components: (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
PdoubleU authored Jun 6, 2022
1 parent 4ae16fa commit 9b36d30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/docs/intro/examples/custom-components-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ export const CustomInfo = ({ customTitle }: Props) => {

```

There are a few new things along with the previously shown code.
First, we need to add two imports: a 'TouchableOpacity' from react-native-gesture-handler and 'useNotificationController' hook provided with react-native-notificated.
'useNotificationController' hook returns method 'remove' which can be applied in our custom notification.
The only thing that has to be done to implement the close button is to add a close button in our return part of the component and invoke remove() on the press event.

Now let's take a look how our examples looks like:

### Advertisement
Expand Down

0 comments on commit 9b36d30

Please sign in to comment.