Daniel Espino Garcia

MVI: Minimum Viable Interface for React Components

Your flexible components are a liability. Learn how a Minimum Viable Interface simplifies development by satisfying only current business needs.

MVI: Minimum Viable Interface for React Components
#1about 2 minutes

Introducing Minimum Viable Interface for business code

MVI is a philosophy for writing business-specific code by keeping the interface of your components as small as possible to satisfy current needs.

#2about 2 minutes

Benefits of a minimal component interface

Reducing component props lowers cognitive load, simplifies testing, makes refactoring easier, and improves overall codebase coherence.

#3about 2 minutes

Defining a React component's interface as its props

For the purpose of MVI, a React component's public interface is defined entirely by the props it accepts.

#4about 3 minutes

Contrasting abstract library code with specific business code

Unlike abstract library code designed for many use cases, business code should be concrete and tailored to solve a single, specific problem.

#5about 1 minute

Applying the YAGNI principle to component props

The "You Ain't Gonna Need It" (YAGNI) principle advises against adding props or features for hypothetical future needs.

#6about 5 minutes

Choosing the right prop types from booleans to styles

A hierarchy of prop types is presented, favoring simple types like booleans and enums over more flexible but dangerous ones like class names or styles.

#7about 3 minutes

Why you should wrap third-party libraries

Encapsulate third-party libraries in your own components to expose only the minimal interface needed, simplifying future refactoring and dependency swaps.

#8about 1 minute

How to avoid impossible component states with props

Design your component props using enums or union types instead of multiple booleans to prevent developers from creating invalid or nonsensical states.

#9about 2 minutes

Addressing the challenges and trade-offs of MVI

While adapting to changing business needs can be uncomfortable with MVI, the long-term benefits of clarity and simplicity often outweigh the initial friction.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

From learning to earning

Jobs that call for the skills explored in this talk.