im learning create shopify custom app using PHP+Laravel/React js,
i have created one form that have some fields, but now i dont know to,
if form has a submit some data then that data will display to product cart page of shopify store,
please advise me that, how we can do that? or suggest me some wau, so i can follow that,
this is my component file. there I have passed handleSubmit , now I don’t get any data in this, please help me on this.
import {gql, useQuery} from ‘@apollo/client’;
import {Banner} from ‘@shopify/polaris’;
import React from ‘react’;
import {Component} from ‘react’;
import ReactDOM from ‘react-dom’;
import {Loading} from ‘@shopify/app-bridge-react’;
import app from “/css/app.css”;
import { useReducer, useState } from ‘react’;
import axios from ‘axios’;
import { useNavigate } from ‘react-router-dom’
import {Provider, useAppBridge} from ‘@shopify/app-bridge-react’;
function WhatsappSharecart() {
const [wp_enable, setWpEnable] = useState(“No”);
const [buttonlabel, setButtonlabel] = useState(“Share on WhatsApp”);
const [cartmessage, setCartmessage] = useState(“Hey! There Watch My Cart.”);
const [buttonposition, setButtonposition] = useState(“Default”);
/const handleSubmit = event => {
event.preventDefault();
alert(Whatsapp Share Cart Enable: ${wp_enable})
alert(Button Label Is: ${buttonlabel})
alert(Cart Message on Whatsapp Share Link Is: ${cartmessage})
alert(Whatsapp Button Position on Cart Page Is: ${buttonposition})
console.log(buttonlabel);
}/