From 034a41ad44144e79c1c58a3b4f8741ddf8d56f8c Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Fri, 16 Apr 2021 18:40:50 +0530 Subject: implemented a way for AddNewItemForm and BillingPage to talk to each other and share data --- src/components/BillingPage.js~ | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/components/BillingPage.js~ (limited to 'src/components/BillingPage.js~') diff --git a/src/components/BillingPage.js~ b/src/components/BillingPage.js~ new file mode 100644 index 0000000..6f5b18b --- /dev/null +++ b/src/components/BillingPage.js~ @@ -0,0 +1,39 @@ +import React from "react"; +import AddNewItemForm from "./Form/AddNewItemForm.js"; + + +const sampleData = [ + { + "Model": "Kisan Chair", + "Description": "Very good chair", + "Price": 10000, + "Discount": 0 + }, { + "Model": "Supreme Chair", + "Description": "Even better chair", + "Price": "2134983", + "Discount": 0 + }, { + "Model": "Action Houseware", + "Description": "Not a chair", + "Price": 69, + "Discount": 0 + } +]; + +let addedItems = []; +const getAddedItems = (item) => { + console.log(item); + addedItems.push(item); + console.log(addedItems); +} + +const BillingPage = () => { + return ( + <> + + + ); +} + +export default BillingPage; -- cgit v1.2.3