( target: Array<Chunk | PrecomputedChunk>, props: Object, resumableState: ResumableState, renderState: RenderState, formatContext: FormatContext, )
| 2425 | } |
| 2426 | |
| 2427 | function 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': |
no test coverage detected