Modal windows are nice to have when you are creating CRUD applications. We will create a simple shopping list app where users can add new items using the modal window. The modal window component that we will use in the example is react-skylight (https://marcio.github.io/react-skylight/):
- Create a new React app called shoppinglist and install react-skylight by using the following command:
npm install react-skylight --save
- Open the app folder with the VS Code and open the App.js file in the code editor. In the App.js component, we need only one state to keep shopping list items. One shopping list item contains two fields—product and amount. We also need a method to add new items to the list. The following is the ...