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

Related Articles

View all articles
BR
Benjamin Ruschin
The HTML Elements That You’re Probably Over-Engineering
As frameworks have become more and more commonplace in the world of web development, so too has the over-engineering of features made possible by our humble old friend, HTML. The mental models that come with using state management in React, Vue and o...
The HTML Elements That You’re Probably Over-Engineering
BR
Benjamin Ruschin
What Developers Really Need to Create Great Code Demos
Every developer on earth has, at some point, had another developer to thank for a breakthrough, a success, an aha moment they wouldn’t have had without coming across that blog post, that open-source contribution, that reply on socials or that humble ...
What Developers Really Need to Create Great Code Demos
DC
Daniel Cranney
Dev Digest 193: Vibe Coding Honeymoon, NaN and the End of Interviews
Inside last week’s Dev Digest 193 . 🛰️ A satellite of doom 🤔 Why em-dashes? 😔 Vibe coding Honeymoon is over 🖼️ GenAI image showdown 🔥 Dangers of firewalls and VPNs 👨‍💼 AI broke interviews 🦉 A LinkedIn wisdom generator 🗞️ Join over 150,000 developers...
Dev Digest 193: Vibe Coding Honeymoon, NaN and the End of Interviews

From learning to earning

Jobs that call for the skills explored in this talk.

Programador/a React?

Programador/a React?

knowmad Mood
Municipality of Palma, Spain

Intermediate
GIT
RxJS
SASS
NoSQL
Redis
+10