Skip to content

Commit

Permalink
Remove setProps and replaceProps from src (facebook#7045)
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 authored and zpao committed Jun 15, 2016
1 parent 97d89fa commit e8fa464
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,6 @@ describe 'ReactCoffeeScriptClass', ->
test Inner(name: 'foo'), 'DIV', 'foo'
expect(-> instance.replaceState {}).toThrow()
expect(-> instance.isMounted()).toThrow()
expect(-> instance.setProps name: 'bar').toThrow()
expect(-> instance.replaceProps name: 'bar').toThrow()
expect(console.error.calls.count()).toBe 2
expect(console.error.calls.argsFor(0)[0]).toContain(
'replaceState(...) is deprecated in plain JavaScript React classes'
Expand Down
2 changes: 0 additions & 2 deletions src/isomorphic/modern/class/__tests__/ReactES6Class-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,6 @@ describe('ReactES6Class', function() {
var instance = test(<Inner name="foo" />, 'DIV', 'foo');
expect(() => instance.replaceState({})).toThrow();
expect(() => instance.isMounted()).toThrow();
expect(() => instance.setProps({name: 'bar'})).toThrow();
expect(() => instance.replaceProps({name: 'bar'})).toThrow();
expect(console.error.calls.count()).toBe(2);
expect(console.error.calls.argsFor(0)[0]).toContain(
'replaceState(...) is deprecated in plain JavaScript React classes'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,6 @@ describe('ReactTypeScriptClass', function() {
);
expect(() => instance.replaceState({})).toThrow();
expect(() => instance.isMounted()).toThrow();
expect(() => instance.setProps({ name: 'bar' })).toThrow();
expect(() => instance.replaceProps({ name: 'bar' })).toThrow();
expect((<any>console.error).calls.count()).toBe(2);
expect((<any>console.error).calls.argsFor(0)[0]).toContain(
'replaceState(...) is deprecated in plain JavaScript React classes'
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shared/stack/reconciler/ReactUpdates.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function enqueueUpdate(component) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case. (This is called by each top-level update
// function, like setProps, setState, forceUpdate, etc.; creation and
// function, like setState, forceUpdate, etc.; creation and
// destruction of top-level components is guarded in ReactMount.)

if (!batchingStrategy.isBatchingUpdates) {
Expand Down

0 comments on commit e8fa464

Please sign in to comment.