In popular programming languages like Java and C#, generics serve as one of the tools for creating reusable components. By using generics, the programmer is able to create safe classes and functions that can operate on objects of various types.
Similarly, Flow offers generics as a way of type abstraction. Check out the docs on the official website to learn the basics. In this article, I want to give you an example of how we use Flow Generics with React components at Coursera.
Imagine you want to build a course selector component, consisting of checkboxes and course labels. A user…
Software Engineer at Airbnb. ex Coursera