facebook/react — pull request #2242 by syranide (2014-09-25 12:25:49+00:00)
Title: Remount ReactDOMInput when changing type

IE8 throws if you change input `type`, It applies to all values of `type` (even unsupported ones).

```JS
React.renderComponent(, document.body);
React.renderComponent(, document.body);
[ERROR for attribute] Could not get the type property. This command is not supported.
[ERROR for property] "This command is not supported."
```

Additionally, all other versions of IE does not respect `checked` unless `type="checkbox"` or `type="radio"`. So changing from `type="textfield"` to `type="checkbox"` while `checked` causes it to be unchecked. Which **should** be an issue for React, except that `ReactDOMInput` explicitly calls `DOMPropertyOperations.setValueForProperty` for every `componentDidUpdate` ([source link](https://github.com/facebook/react/blob/master/src/browser/ui/dom/components/ReactDOMInput.js#L107)). Why? Seems wasteful.

It seems to me that the correct solution (to all of this) is to consider a different `type` as a different component. `type` is a really weird HTML feature, which to me is akin to transforming `span` into `div` rather than remounting... which we don't.

cc @zpao @spicyj

(PS. PR just because, not saying we should take it as-is)