Member-only story

The most inappropriate use case for React

Even with an auxiliary fully fledged library

Marian C.
6 min readDec 13, 2021

Although the React documentation recommends to use React only for the fragments of a user interface where it is useful, React tends to be used as a framework for the entire application.

According React documentation, it can be tedious and annoying to use React in forms. In React, instead of just using the built-in functionalities of forms, you have to replicate them in your code. In React controlled inputs, for example, are used like editable divs.

To facilitate work with forms, the React documentation recommends using a fully-fledged solution — Formik, a React-based library solving form-related problems inflicted by React.

Considering that the form controls can have attributes specifying acceptable values and that all modern browsers support Constraint validation API, it is not clear is if creating forms with React-based recommended libraries can be as easy as without React.

Build forms in React without the tears

Formik is an auxiliary library for React facilitating the 3 most annoying parts:

  1. Getting values in and out of form state
  2. Validation and error messages

--

--

Marian C.
Marian C.

Written by Marian C.

Java, JavaScript and SQL developer. Interested in data collection and visualization.

Responses (2)