Working with controlled component in reactjs. Letting reactjs control input elements for component monitoring. By controlled component the source of truth is delegated to the parent component that handles the state which is the used as the props for any embedded component in the main component. This sample makes use of react default data management structure which is handling the state within the component, it does not use any third party state management library like immutability or redux.
npm install
npm install react react-dom --save
npm install --save-dev babel-loader
npm install --save-dev babel-preset-env babel-preset-react
which is said to be included in the preset-env formally preset-es2015, yet you still have to install to
npm install --save-dev babel-plugin-transform-object-rest-spread
plugins: [transform-object-rest-spread]
npm install webpack -g
npm install --save-dev webpack
webpack
A little bit of extra, you could decide to run a dev server in hot mode instead of firing up the app in other local local server.
npm install --save-dev webpack-dev-server
'scripts': { start : webpack-dev-server --hot }
npm start