mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add display names to controlled components
These show up as Unknown in the DevTools. They also wrap a native component, so they show up double.
This commit is contained in:
committed by
Paul O’Shannessy
parent
f3e774559f
commit
cbefc5a968
@@ -45,6 +45,8 @@ var mouseListenerNames = keyMirror({
|
||||
* when `disabled` is set.
|
||||
*/
|
||||
var ReactDOMButton = ReactCompositeComponent.createClass({
|
||||
displayName: 'ReactDOMButton',
|
||||
|
||||
mixins: [AutoFocusMixin],
|
||||
|
||||
render: function() {
|
||||
|
||||
@@ -33,6 +33,8 @@ var form = ReactDOM.form;
|
||||
* composite component and use `componentDidMount` to attach the event handlers.
|
||||
*/
|
||||
var ReactDOMForm = ReactCompositeComponent.createClass({
|
||||
displayName: 'ReactDOMForm',
|
||||
|
||||
render: function() {
|
||||
// TODO: Instead of using `ReactDOM` directly, we should use JSX. However,
|
||||
// `jshint` fails to parse JSX so in order for linting to work in the open
|
||||
|
||||
@@ -50,6 +50,8 @@ var instancesByReactID = {};
|
||||
* @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
|
||||
*/
|
||||
var ReactDOMInput = ReactCompositeComponent.createClass({
|
||||
displayName: 'ReactDOMInput',
|
||||
|
||||
mixins: [LinkedValueMixin, AutoFocusMixin],
|
||||
|
||||
getInitialState: function() {
|
||||
|
||||
@@ -28,6 +28,7 @@ var option = ReactDOM.option;
|
||||
* Implements an <option> native component that warns when `selected` is set.
|
||||
*/
|
||||
var ReactDOMOption = ReactCompositeComponent.createClass({
|
||||
displayName: 'ReactDOMOption',
|
||||
|
||||
componentWillMount: function() {
|
||||
// TODO (yungsters): Remove support for `selected` in <option>.
|
||||
|
||||
@@ -100,6 +100,8 @@ function updateOptions() {
|
||||
* selected.
|
||||
*/
|
||||
var ReactDOMSelect = ReactCompositeComponent.createClass({
|
||||
displayName: 'ReactDOMSelect',
|
||||
|
||||
mixins: [LinkedValueMixin, AutoFocusMixin],
|
||||
|
||||
propTypes: {
|
||||
|
||||
@@ -46,6 +46,8 @@ var textarea = ReactDOM.textarea;
|
||||
* `defaultValue` if specified, or the children content (deprecated).
|
||||
*/
|
||||
var ReactDOMTextarea = ReactCompositeComponent.createClass({
|
||||
displayName: 'ReactDOMTextarea',
|
||||
|
||||
mixins: [LinkedValueMixin, AutoFocusMixin],
|
||||
|
||||
getInitialState: function() {
|
||||
|
||||
Reference in New Issue
Block a user