Open porrodv opened 6 days ago
Hey @porrodv
Try something like this:
fetcher.submit(
{
cartFormInput: JSON.stringify({
action: 'ActionTest',
inputs: {
test: ['test1', 'test2'],
},
}),
},
{method: 'POST', action: '/cart'},
);
What is the location of your example repository?
No response
Which package or tool is having this issue?
Hydrogen
What version of that package or tool are you using?
2024.1.1
What version of Remix are you using?
2.4.1
Steps to Reproduce
For example, I have a button in a component that uses useFetcher() for send data to locale cart route
in
($locale).cart.tsx
i have this actionThe logs are this:
I think it may be an error in how CartForm.getFormInput() handles the data.
This is just an example but the problem does not allow me integrate useFetcher with Shopify Hydrogen Cart.
I see the official documentation but the result is the same
https://shopify.dev/docs/api/hydrogen/2023-07/components/cartform#example-cartform-with-fetcher
Expected Behavior
Logs
This is how data arrives using component
Actual Behavior
Logs