From d4e32a7b2c354c1e99134543b41738d121d5b98c Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Thu, 20 Nov 2014 23:07:58 -0800 Subject: [PATCH] Finish renaming renderComponent -> render Test Plan: jest --- src/browser/server/__tests__/ReactServerRendering-test.js | 4 ++-- src/browser/ui/ReactMount.js | 4 ++-- src/browser/ui/__tests__/ReactMount-test.js | 4 ++-- src/browser/ui/__tests__/ReactRenderDocument-test.js | 2 +- src/browser/ui/dom/Danger.js | 2 +- src/core/ReactComponent.js | 4 ++-- src/core/ReactCompositeComponent.js | 4 ++-- src/core/ReactElementValidator.js | 2 +- src/core/__tests__/ReactEmptyComponent-test.js | 2 +- src/core/__tests__/ReactUpdates-test.js | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/browser/server/__tests__/ReactServerRendering-test.js b/src/browser/server/__tests__/ReactServerRendering-test.js index e137444a7552..d6b9a5c59357 100644 --- a/src/browser/server/__tests__/ReactServerRendering-test.js +++ b/src/browser/server/__tests__/ReactServerRendering-test.js @@ -50,7 +50,7 @@ describe('ReactServerRendering', function() { ID_ATTRIBUTE_NAME = DOMProperty.ID_ATTRIBUTE_NAME; }); - describe('renderComponentToString', function() { + describe('renderToString', function() { it('should generate simple markup', function() { var response = ReactServerRendering.renderToString( hello world @@ -244,7 +244,7 @@ describe('ReactServerRendering', function() { }); }); - describe('renderComponentToStaticMarkup', function() { + describe('renderToStaticMarkup', function() { it('should not put checksum and React ID on components', function() { var lifecycle = []; var NestedComponent = React.createClass({ diff --git a/src/browser/ui/ReactMount.js b/src/browser/ui/ReactMount.js index 218a020667d5..6f990163c591 100644 --- a/src/browser/ui/ReactMount.js +++ b/src/browser/ui/ReactMount.js @@ -377,7 +377,7 @@ var ReactMount = { render: function(nextElement, container, callback) { invariant( ReactElement.isValidElement(nextElement), - 'renderComponent(): Invalid component element.%s', + 'React.render(): Invalid component element.%s', ( typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + @@ -756,7 +756,7 @@ var ReactMount = { 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + - 'See renderComponentToString() for server rendering.' + 'See React.renderToString() for server rendering.' ); setInnerHTML(container, markup); diff --git a/src/browser/ui/__tests__/ReactMount-test.js b/src/browser/ui/__tests__/ReactMount-test.js index b82daaa3a60f..f9d3aad8d29d 100644 --- a/src/browser/ui/__tests__/ReactMount-test.js +++ b/src/browser/ui/__tests__/ReactMount-test.js @@ -46,7 +46,7 @@ describe('ReactMount', function() { expect(function() { ReactTestUtils.renderIntoDocument('div'); }).toThrow( - 'Invariant Violation: renderComponent(): Invalid component element. ' + + 'Invariant Violation: React.render(): Invalid component element. ' + 'Instead of passing an element string, make sure to instantiate it ' + 'by passing it to React.createElement.' ); @@ -61,7 +61,7 @@ describe('ReactMount', function() { expect(function() { ReactTestUtils.renderIntoDocument(Component); }).toThrow( - 'Invariant Violation: renderComponent(): Invalid component element. ' + + 'Invariant Violation: React.render(): Invalid component element. ' + 'Instead of passing a component class, make sure to instantiate it ' + 'by passing it to React.createElement.' ); diff --git a/src/browser/ui/__tests__/ReactRenderDocument-test.js b/src/browser/ui/__tests__/ReactRenderDocument-test.js index 3f653ead7575..6e18257fb4b8 100644 --- a/src/browser/ui/__tests__/ReactRenderDocument-test.js +++ b/src/browser/ui/__tests__/ReactRenderDocument-test.js @@ -240,7 +240,7 @@ describe('rendering React components at document', function() { 'Invariant Violation: You\'re trying to render a component to the ' + 'document but you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. See ' + - 'renderComponentToString() for server rendering.' + 'React.renderToString() for server rendering.' ); }); diff --git a/src/browser/ui/dom/Danger.js b/src/browser/ui/dom/Danger.js index a4c90c235dfb..270d6d28bbb6 100644 --- a/src/browser/ui/dom/Danger.js +++ b/src/browser/ui/dom/Danger.js @@ -170,7 +170,7 @@ var Danger = { 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + ' node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + - 'server rendering. See renderComponentToString().' + 'server rendering. See React.renderToString().' ); var newChild = createNodesFromMarkup(markup, emptyFunction)[0]; diff --git a/src/core/ReactComponent.js b/src/core/ReactComponent.js index 694d9578dd17..6eed4a0394a7 100644 --- a/src/core/ReactComponent.js +++ b/src/core/ReactComponent.js @@ -166,8 +166,8 @@ var ReactComponent = { /** * Get the publicly accessible representation of this component - i.e. what - * is exposed by refs and renderComponent. Can be null for stateless - * components. + * is exposed by refs and returned by React.render. Can be null for + * stateless components. * * @return {?ReactComponent} the actual sibling Component. * @internal diff --git a/src/core/ReactCompositeComponent.js b/src/core/ReactCompositeComponent.js index 192de12e4eb8..6c7d12d4b4a7 100644 --- a/src/core/ReactCompositeComponent.js +++ b/src/core/ReactCompositeComponent.js @@ -517,7 +517,7 @@ var ReactCompositeComponentMixin = assign({}, propTypes[propName](props, propName, componentName, location); if (error instanceof Error) { // We may want to extend this logic for similar errors in - // renderComponent calls, so I'm abstracting it away into + // React.render calls, so I'm abstracting it away into // a function to minimize refactoring in the future var addendum = getDeclarationErrorAddendum(this); warning(false, error.message + addendum); @@ -864,7 +864,7 @@ var ReactCompositeComponentMixin = assign({}, /** * Get the publicly accessible representation of this component - i.e. what - * is exposed by refs and renderComponent. Can be null for stateless + * is exposed by refs and returned by React.render. Can be null for stateless * components. * * @return {ReactComponent} the public component instance. diff --git a/src/core/ReactElementValidator.js b/src/core/ReactElementValidator.js index 51866856dd11..687183bf6549 100644 --- a/src/core/ReactElementValidator.js +++ b/src/core/ReactElementValidator.js @@ -120,7 +120,7 @@ function warnAndMonitorForKeyUse(warningID, message, element, parentType) { message += ownerName ? ` Check the render method of ${ownerName}.` : - ` Check the renderComponent call using <${parentName}>.`; + ` Check the React.render call using <${parentName}>.`; // Usually the current owner is the offender, but if it accepts children as a // property, it may be the creator of the child that's responsible for diff --git a/src/core/__tests__/ReactEmptyComponent-test.js b/src/core/__tests__/ReactEmptyComponent-test.js index ee6434e60ca8..8236db353952 100644 --- a/src/core/__tests__/ReactEmptyComponent-test.js +++ b/src/core/__tests__/ReactEmptyComponent-test.js @@ -228,7 +228,7 @@ describe('ReactEmptyComponent', function() { expect(function() { React.render(null, div); }).toThrow( - 'Invariant Violation: renderComponent(): Invalid component element.' + 'Invariant Violation: React.render(): Invalid component element.' ); }); }); diff --git a/src/core/__tests__/ReactUpdates-test.js b/src/core/__tests__/ReactUpdates-test.js index 7ca5953936cc..776c2c0bd9a8 100644 --- a/src/core/__tests__/ReactUpdates-test.js +++ b/src/core/__tests__/ReactUpdates-test.js @@ -641,7 +641,7 @@ describe('ReactUpdates', function() { componentDidMount: function() { instances.push(this); if (this.props.depth < this.props.count) { - React.renderComponent( + React.render(