MCPcopy Index your code
hub / github.com/react/react / pushInput

Function pushInput

packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js:2427–2570  ·  view source on GitHub ↗
(
  target: Array<Chunk | PrecomputedChunk>,
  props: Object,
  resumableState: ResumableState,
  renderState: RenderState,
  formatContext: FormatContext,
)

Source from the content-addressed store, hash-verified

2425}
2426
2427function pushInput(
2428 target: Array<Chunk | PrecomputedChunk>,
2429 props: Object,
2430 resumableState: ResumableState,
2431 renderState: RenderState,
2432 formatContext: FormatContext,
2433): ReactNodeList {
2434 if (__DEV__) {
2435 checkControlledValueProps('input', props);
2436 }
2437
2438 target.push(startChunkForTag('input'));
2439
2440 let name = null;
2441 let formAction = null;
2442 let formEncType = null;
2443 let formMethod = null;
2444 let formTarget = null;
2445 let value = null;
2446 let defaultValue = null;
2447 let checked = null;
2448 let defaultChecked = null;
2449
2450 for (const propKey in props) {
2451 if (hasOwnProperty.call(props, propKey)) {
2452 const propValue = props[propKey];
2453 if (propValue == null) {
2454 continue;
2455 }
2456 switch (propKey) {
2457 case 'children':
2458 case 'dangerouslySetInnerHTML':
2459 throw new Error(
2460 `${'input'} is a self-closing tag and must neither have \`children\` nor ` +
2461 'use `dangerouslySetInnerHTML`.',
2462 );
2463 case 'name':
2464 name = propValue;
2465 break;
2466 case 'formAction':
2467 formAction = propValue;
2468 break;
2469 case 'formEncType':
2470 formEncType = propValue;
2471 break;
2472 case 'formMethod':
2473 formMethod = propValue;
2474 break;
2475 case 'formTarget':
2476 formTarget = propValue;
2477 break;
2478 case 'defaultChecked':
2479 defaultChecked = propValue;
2480 break;
2481 case 'defaultValue':
2482 defaultValue = propValue;
2483 break;
2484 case 'checked':

Callers 1

pushStartInstanceFunction · 0.85

Calls 9

startChunkForTagFunction · 0.85
pushAttributeFunction · 0.85
pushFormActionAttributeFunction · 0.85
pushBooleanAttributeFunction · 0.85
pushAdditionalFormFieldsFunction · 0.85
pushMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected