I recently stumbled across react-mailcheck, a React Component from the mailcheck library that suggests domains based on common typos in email forms. For example, ‘email@example.com’ will generate a suggestion for ‘firstname.lastname@example.org’. It’s perfect for preventing errors in user signups, and the authors claim its reduced their email bounces by 50%. Today I will take you through how you can add this feature to your signup forms.
Without further ado, let’s get on with the set up!
Download the source code of this project on Github.
Setting up the folder structure
npm install --save react-mailcheck
Here is the folder structure we will be left with after the dust settles:
Create a new project and create all the files and folders above.
The project has two main folders: app and bundles. The app folder contains app.jsx and styles.scss. The bundles folder will contain our bundled files that are generated by webpack.All the other files ( index.html, package.json, tsconfig.json, tslint.json, webpack.config.json) are located in the root folder of our project.
I use a similar setup for all my projects. You can adopt the whole setup or include what you find necessary.
Now add the following scripts to your package.json