* 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 trigger updates
(element, props)
| 14796 | */ |
| 14797 | |
| 14798 | function getHostProps$3(element, props) { |
| 14799 | var node = element; |
| 14800 | !(props.dangerouslySetInnerHTML == null) ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : void 0; |
| 14801 | |
| 14802 | // Always set children to the same thing. In IE9, the selection range will |
| 14803 | // get reset if `textContent` is mutated. We could add a check in setTextContent |
| 14804 | // to only set the value if/when the value differs from the node value (which would |
| 14805 | // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this |
| 14806 | // solution. The value can be a boolean or object so that's why it's forced |
| 14807 | // to be a string. |
| 14808 | var hostProps = _assign({}, props, { |
| 14809 | value: undefined, |
| 14810 | defaultValue: undefined, |
| 14811 | children: '' + node._wrapperState.initialValue |
| 14812 | }); |
| 14813 | |
| 14814 | return hostProps; |
| 14815 | } |
| 14816 | |
| 14817 | function initWrapperState$2(element, props) { |
| 14818 | var node = element; |
no test coverage detected