robcalcroft / react-native-in-app-notification

:bell: Customisable in-app notification component for React Native
MIT License
269 stars 78 forks source link

Support for custom components as notificationBody #10

Closed die20 closed 6 years ago

die20 commented 6 years ago

Hey!

I needed a way to add a custom component as the notification body - this method allows for you to use a custom component, it will not use the default notification body if a customComponent is found.

Just thought it'd be a good addition :)

Thanks

robcalcroft commented 6 years ago

Hey! Thanks for the PR. I'm a bit confused on what this PR adds. Isn't the point of notification body that it already supports a custom component to be used for the Notification?

die20 commented 6 years ago

Oh, maybe it does - I didn't pick up on that from the docs. How would I pass in a custom component to the plugin?

When I say a custom component, I mean one that is formatted and styled on its own. Not just changing the title, text, icon, onPress parts of the notification.

In my use case, I needed to show a notification with dynamic content where up to 4 icons are displayed and 2-3 lines of text.

robcalcroft commented 6 years ago

Yeah you can just add your custom component using the notificationBodyComponent prop

robcalcroft commented 6 years ago

Closing this due to inactivity