Coder Social home page Coder Social logo

form-designer-with-react's Introduction

Develop a Form Designer with React

Business Requirement:

You need to write a form designer, which has these features:

  • Select field type and add a field
  • Remove field
  • Preview

Select field type and add a field

There should have an 'Add' button on the page. When you click on it, it will pop up a dialog for choosing the field type.

In the 'Choose Type' dialog, there are two types of field: Text and Date. You can choose your favarite type and click 'Add' button to add it on the design form or click '�Close' to close this dialog.

After you add a field type, the dialog will keep opening so that you can continue to choose and add more fields to the form.

Remove field

There should have a 'Remove' button on the right of each field. When you click it, the field will be removed from the form.

Preview

There should have a 'Preview' button on the page. When you click it, the button caption will change to 'Edit' so we can toggle between edit mode and previewmode. In the preview mode, you can either add a new field or remove a field.

Practice Challenges:

  • Understand the difference between declarative and imperative programming
  • Design the structure of components appropriately
  • Understand the difference between state and props
  • Understand how the 'event' work in React
  • Understand the concept of Virtual DOM and apply it
  • Lean how to remove specific field
  • Lean how to use jQuery UI dialog widget with React

Practice Requirements:

  • Do tasking and break tasks in appropriate smallunits and commit code after completing each task
  • Commit frequently with readable comment
  • Coding with shortcuts

Practice Output:

HTML and JavaScript (CSS is optional).

Environment:

  • HTML 5
  • JavaScript ES6
  • React 16.0.0
  • React DOM 16.0.0
  • jQuery UI 1.12.1

How to Start:

Open your terminal, change into any path and clone this repository:

git clone repo_of_this_template

Install dependencies:

npm install

Start server:

npm start

Then open http://127.0.0.1:8080/src/main.html in your browser.

Open the project in your favorite editor, write JavaScript in src/js/main.js and HTML in src/main.html. Once completed, use git command below to set the origin of this repository:

 git remote set-url origin my_url

Then push your code into your own remote repository.

Learning Resources:

  1. JavaScript Basics
  2. JavaScript Code Camp
  3. JavaScript Objects
  4. ECMAScript 6 Features
  5. Install Node
  6. Install NPM
  7. Git Reference
  8. React Tutorial

form-designer-with-react's People

Contributors

seabornlee avatar zjx-immersion avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.