Remove constructAndRenderComponent
These were never part of the public API and shouldn't have been part of the React object. Now they're not.
Ben Alpert committed
Jun 10, 2015 at 13:55 UTC
d810079101ae9ca6fb836f4d4d44bdb26a123ec9
3 files changed
-47
src/renderers/dom/ReactDOMClient.js
-2
@@ -29,8 +29,6 @@ ReactDefaultInjection.inject();
29
var render = ReactPerf.measure('React', 'render', ReactMount.render);
30
31
var React = {
32
- constructAndRenderComponent: ReactMount.constructAndRenderComponent,
33
- constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,
32
findDOMNode: findDOMNode,
33
render: render,
34
unmountComponentAtNode: ReactMount.unmountComponentAtNode,
src/renderers/dom/client/ReactMount.js
-33
@@ -595,39 +595,6 @@ var ReactMount = {
595
return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
596
},
597
598
- /**
599
- * Constructs a component instance of `constructor` with `initialProps` and
600
- * renders it into the supplied `container`.
601
- *
602
- * @param {function} constructor React component constructor.
603
- * @param {?object} props Initial props of the component instance.
604
- * @param {DOMElement} container DOM element to render into.
605
- * @return {ReactComponent} Component instance rendered in `container`.
606
- */
607
- constructAndRenderComponent: function(constructor, props, container) {
608
- var element = ReactElement.createElement(constructor, props);
609
- return ReactMount.render(element, container);
610
- },
611
-
612
- /**
613
- * Constructs a component instance of `constructor` with `initialProps` and
614
- * renders it into a container node identified by supplied `id`.
615
- *
616
- * @param {function} constructor React component constructor
617
- * @param {?object} props Initial props of the component instance.
618
- * @param {string} id ID of the DOM element to render into.
619
- * @return {ReactComponent} Component instance rendered in the container node.
620
- */
621
- constructAndRenderComponentByID: function(constructor, props, id) {
622
- var domNode = document.getElementById(id);
623
- invariant(
624
- domNode,
625
- 'Tried to get element with id of "%s" but it is not present on the page.',
626
- id
627
- );
628
- return ReactMount.constructAndRenderComponent(constructor, props, domNode);
629
- },
630
-
598
/**
599
* Registers a container node into which React components will be rendered.
600
* This also creates the "reactRoot" ID that will be assigned to the element
src/renderers/dom/client/__tests__/ReactMount-test.js
-12
@@ -29,18 +29,6 @@ describe('ReactMount', function() {
29
// Leave WebComponents undefined.
30
}
31
32
- describe('constructAndRenderComponentByID', function() {
33
- it('throws if given an id for a component that doesn\'t exist', function() {
34
- expect(function() {
35
- ReactMount.constructAndRenderComponentByID(
36
- function dummyComponentConstructor() {},
37
- {},
38
- 'SOME_ID_THAT_DOESNT_EXIST'
39
- );
40
- }).toThrow();
41
- });
42
- });
43
-
32
describe('unmountComponentAtNode', function() {
33
it('throws when given a non-node', function() {
34
var nodeArray = document.getElementsByTagName('div');