Skip to content

Commit

Permalink
Rename componentWillReceiveProps
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tran committed Jul 3, 2018
1 parent 2258262 commit e708806
Show file tree
Hide file tree
Showing 9 changed files with 9,918 additions and 19 deletions.
9,899 changes: 9,899 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/react-relay/classic/container/RelayContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ function createContainerComponent(
);
}

componentWillReceiveProps(
UNSAFE_componentWillReceiveProps(
nextProps: Object,
maybeNextContext?: RelayContainerContext,
): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class RelayReadyStateRenderer extends React.Component<
};
}

componentWillReceiveProps(nextProps: Props): void {
UNSAFE_componentWillReceiveProps(nextProps: Props): void {
if (
this.props.environment !== nextProps.environment ||
this.props.queryConfig !== nextProps.queryConfig
Expand Down
2 changes: 1 addition & 1 deletion packages/react-relay/classic/container/RelayRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class RelayRenderer extends React.Component<Props, State> {
}
}

componentWillReceiveProps(nextProps: Props): void {
UNSAFE_componentWillReceiveProps(nextProps: Props): void {
if (
nextProps.Container !== this.props.Container ||
nextProps.environment !== this.props.environment ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('RelayCompatFragmentContainer', () => {
this.relay = {environment, variables};
this.state = {props: null};
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const {environment, variables} = nextProps;
if (
environment !== this.relay.environment ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ function createContainerWithFragments<
* for updates. Props may be the same in which case previous data and
* subscriptions can be reused.
*/
componentWillReceiveProps(nextProps, nextContext) {
UNSAFE_componentWillReceiveProps(nextProps, nextContext) {
const context = nullthrows(nextContext);
const relay = assertRelayContext(context.relay);
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('ReactRelayFragmentContainer', () => {
this.relay = {environment, variables};
this.state = {props: null};
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// eslint-disable-next-line no-shadow
const {environment, variables} = nextProps;
if (
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('ReactRelayFragmentContainer', () => {
expect.extend(RelayModernTestUtils.matchers);

environment = createMockEnvironment();
({UserFragment, UserQuery} = environment.mock.compile(
(({UserFragment, UserQuery} = environment.mock.compile(
`
query UserQuery($id: ID!) {
node(id: $id) {
Expand All @@ -90,7 +90,7 @@ describe('ReactRelayFragmentContainer', () => {
name @include(if: $cond)
}
`,
));
)));

render = jest.fn(() => <div />);
spec = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('ReactRelayPaginationContainer', () => {
this.relay = {environment, variables};
this.state = {props: null};
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// eslint-disable-next-line no-shadow
const {environment, variables} = nextProps;
if (
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('ReactRelayPaginationContainer', () => {
environment = createMockEnvironment({
handlerProvider: () => ConnectionHandler,
});
({UserFragment, UserQuery} = generateAndCompile(
(({UserFragment, UserQuery} = generateAndCompile(
`
query UserQuery(
$after: ID
Expand Down Expand Up @@ -116,10 +116,10 @@ describe('ReactRelayPaginationContainer', () => {
}
}
`,
));
)));

render = jest.fn(props => {
({hasMore, isLoading, loadMore, refetchConnection} = props.relay);
(({hasMore, isLoading, loadMore, refetchConnection} = props.relay));
return <div />;
});
variables = {
Expand Down Expand Up @@ -687,7 +687,7 @@ describe('ReactRelayPaginationContainer', () => {
});

it('fails if missing @connection directive', () => {
({UserFragment, UserQuery} = generateAndCompile(
(({UserFragment, UserQuery} = generateAndCompile(
`
query UserQuery(
$after: ID
Expand Down Expand Up @@ -715,7 +715,7 @@ describe('ReactRelayPaginationContainer', () => {
}
}
`,
));
)));

TestContainer = ReactRelayPaginationContainer.createContainer(
TestComponent,
Expand Down Expand Up @@ -747,7 +747,7 @@ describe('ReactRelayPaginationContainer', () => {

it('does not fail invariant if one fragment has a @connection directive', () => {
let ViewerFragment;
({UserFragment, UserQuery, ViewerFragment} = generateAndCompile(
(({UserFragment, UserQuery, ViewerFragment} = generateAndCompile(
`
query UserQuery(
$after: ID
Expand Down Expand Up @@ -786,7 +786,7 @@ describe('ReactRelayPaginationContainer', () => {
}
}
`,
));
)));

TestContainer = ReactRelayPaginationContainer.createContainer(
TestComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('ReactRelayRefetchContainer', () => {
this.relay = {environment, variables};
this.state = {props: null};
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// eslint-disable-next-line no-shadow
const {environment, variables} = nextProps;
if (
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('ReactRelayRefetchContainer', () => {
expect.extend(RelayModernTestUtils.matchers);

environment = createMockEnvironment();
({UserFragment, UserQuery} = environment.mock.compile(
(({UserFragment, UserQuery} = environment.mock.compile(
`
query UserQuery(
$id: ID!
Expand All @@ -94,7 +94,7 @@ describe('ReactRelayRefetchContainer', () => {
name @include(if: $cond)
}
`,
));
)));

ContextGetter = class extends React.Component {
componentDidMount() {
Expand Down

0 comments on commit e708806

Please sign in to comment.