- Install application related packages:
npm install
- Development:
npm run start
- Build:
npm run build
- Implement Responsive web design
- Render user list with unique key, which is designated
serialNo
- Use this
serialNo
to decide which user to edit, which user to remove - If serialNo equals to 0, the editing user is a new one; if any number(1,2,3...), the editing user is an existing one
- If user list updated (add/delete), users' serialNo will be re-assigned with new order
- It's placed inside Modal because only Modal needs the information
- A form contains needed fields objects
- Every field has its own object with value and error message
- Whether a field is valid or not depends on its error message string. If valid, it's empty; If invalid, it will be why it's invalid
- If input is changed (touched), matching error message will show accordingly
- Since we have to compare user name's uniqueness,
userList
is passed in to Modal - When submit, check all fields' validity. If any is invalid, update error messages of them. If all are valid, use editing
serialNo
to decide whether it is create or edit, and pass value to callback function from outside