MCPcopy
hub / github.com/facebook/react / submit

Function submit

packages/react-dom/src/__tests__/ReactDOMFizzForm-test.js:60–76  ·  view source on GitHub ↗
(submitter)

Source from the content-addressed store, hash-verified

58 });
59
60 function submit(submitter) {
61 const form = submitter.form || submitter;
62 if (!submitter.form) {
63 submitter = undefined;
64 }
65 const submitEvent = new Event('submit', {bubbles: true, cancelable: true});
66 submitEvent.submitter = submitter;
67 const returnValue = form.dispatchEvent(submitEvent);
68 if (!returnValue) {
69 return;
70 }
71 const action =
72 (submitter && submitter.getAttribute('formaction')) || form.action;
73 if (!/\s*javascript:/i.test(action)) {
74 throw new Error('Navigate to: ' + action);
75 }
76 }
77
78 async function readIntoContainer(stream) {
79 const reader = stream.getReader();

Callers 1

Calls 1

testMethod · 0.45

Tested by

no test coverage detected