MCPcopy Create free account
hub / github.com/microsoft/SandDance / getHostProps$3

Function getHostProps$3

docs/external/js/react-dom.development.js:2457–2479  ·  view source on GitHub ↗

* Implements a host component that allows setting `value`, and * `defaultValue`. This differs from the traditional DOM API because value is * usually set as PCDATA children. * * If `value` is not supplied (or null/undefined), user actions that affect the * value will trigge

(element, props)

Source from the content-addressed store, hash-verified

2455 * `defaultValue` if specified, or the children content (deprecated).
2456 */
2457 function getHostProps$3(element, props) {
2458 var node = element;
2459
2460 if (!(props.dangerouslySetInnerHTML == null)) {
2461 {
2462 throw Error( "`dangerouslySetInnerHTML` does not make sense on <textarea>." );
2463 }
2464 } // Always set children to the same thing. In IE9, the selection range will
2465 // get reset if `textContent` is mutated. We could add a check in setTextContent
2466 // to only set the value if/when the value differs from the node value (which would
2467 // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
2468 // solution. The value can be a boolean or object so that's why it's forced
2469 // to be a string.
2470
2471
2472 var hostProps = _assign({}, props, {
2473 value: undefined,
2474 defaultValue: undefined,
2475 children: toString(node._wrapperState.initialValue)
2476 });
2477
2478 return hostProps;
2479 }
2480 function initWrapperState$2(element, props) {
2481 var node = element;
2482

Callers 2

setInitialPropertiesFunction · 0.85
diffPropertiesFunction · 0.85

Calls 1

toStringFunction · 0.70

Tested by

no test coverage detected