Custom Alert in React Native using Context API

Meriç Melike Yılmaz
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…

--

--

Meriç Melike Yılmaz

Head of Engineering @ envanterium & Co-founder @ walbit.io — Formerly @ bunq — IEL’12, KU’17