/opt/canhelp/node_modules/next/dist/esm/client
Edit: /opt/canhelp/node_modules/next/dist/esm/client/form.js (5212B)
'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { useContext, forwardRef } from 'react';
import { addBasePath } from './add-base-path';
import { RouterContext } from '../shared/lib/router-context.shared-runtime';
import { checkFormActionUrl, createFormSubmitDestinationUrl, DISALLOWED_FORM_PROPS, hasReactClientActionAttributes, hasUnsupportedSubmitterAttributes } from './form-shared';
const Form = /*#__PURE__*/ forwardRef(function FormComponent(param, ref) {
let { replace, scroll, prefetch: prefetchProp, ...props } = param;
const router = useContext(RouterContext);
const actionProp = props.action;
const isNavigatingForm = typeof actionProp === 'string';
// Validate `action`
if (process.env.NODE_ENV === 'development') {
if (isNavigatingForm) {
checkFormActionUrl(actionProp, 'action');
}
}
// Validate `prefetch`
if (process.env.NODE_ENV === 'development') {
if (prefetchProp !== undefined) {
console.error('Passing `prefetch` to a