Custom Alert in React Native using Context API
5 min readMay 10, 2020
We needed an alert module for our React Native app. There is the React Native Alert API which is super easy to use, but it is very flat and not customizable at all. We wanted our alerts to look a bit fancier with some coloring. As our design library we use UI Kitten (it’s beautiful & highly recommended), and its Modal
component seemed like the ideal starting point.
Now, we could just put a modal in the app container and keep an app-wide (or reducer) state to tell us whether to keep the modal open and what the message inside will be. But we want to…