KBLNY / react-native-message-bar

A notification bar alert displayed at the top of the screen for react-native
MIT License
442 stars 125 forks source link

Different callbacks for each alert #8

Closed emiraydin closed 8 years ago

emiraydin commented 8 years ago

Currently, callbacks are read from props of the MessageBar component. This limits our ability to define a different callback for each alert. State is already updated with props passed via MessageBar.showAlert function so why not use state to call these callbacks instead of component props? This way we can define different callbacks for each alert.

This also makes it easier to deal with callbacks when you have a single MessageBar component below top level parent component and simply update it each time.

KBLNY commented 8 years ago

Hi, thanks for your feedback. I saw that because it causes a bug. I fixed it prior to your PR and now available in the v1.4.2. Thanks.