/react-useform

Learning Input Validation with React hooks based on https://upmostly.com/tutorials/form-validation-using-custom-react-hooks

Primary LanguageJavaScript

React Banner

React useForm

This is a practice repo for using custom hooks for forms in React.

Table of Contents

Setting up the project with Docker

For those that are not interested in setting up the project manually or would simply not have to worry about downloading python and its dependencies, I have created a Dockerfile and docker-compose.yml file to help create a container with everything you would need to run the project.

Install Docker

To make this as easy as possible, we will be using Docker Compose to creat our container.

$ docker-compose --version
docker-compose version 1.26.2, build eefe0d31

Build and Run the Container

  • Clone the repo to your local machine:
$ git clone https://github.com/rmiyazaki6499/react-useform.git
  • Go into the project directory to build and run the container with:
$ cd react-useform/
$ docker-compose up --build

Navigate to http://localhost:3000 to view the site on the local server. It should look something like this:

React Form

Cleaning up the Container and Image

To stop the container from running, use <Ctrl-C> twice. To close down the container use the command:

$ docker-compose down

Then to clean up the container and image which we are no longer using use the command:

$ docker system prune -fa

Confirm that the container and image is no longer there with:

$ docker system df -v

Inspiration

Form Validation Using Custom React Hooks

Author

Created by: