Validating forms in React can take several lines of code to build. However, Formik's ErrorMessage component and Yup simplify that process. import { ErrorMessage, Field, Form, Formik } from 'formik'; import React from 'react'; import { render } from '…
Starting from v15.5 if we wanted to use React's PropTypes we had to change our code to use a separate node module, now we can go one step further and get rid of that extra dependency just by using flow type annotations in our create-react-app project…
The data contained in this.props.children is not always what you might expect. React provides React.children to allow for a more consistent development experience. For example, you have an component: class App extends React.Component { render(){ retu…
We’ll create a Router component that will wrap our application and manage all URL related state. We’ll see how we can use React’s built in context mechanism to pass data and functions between components without having to pass props all the way down t…
Error Boundaries are the way you handle errors with React, and Suspense embraces this completely. Let's take a look at how to handle asynchronous errors with Suspense and Error Boundaries. In previous post, we used React.Suspense with fallback (for l…