Skip to content

Commit

Permalink
Relay: Fix hasFragmentData for Non-Deferred Fragments
Browse files Browse the repository at this point in the history
Reviewed By: josephsavona

Differential Revision: D3096558

fb-gh-sync-id: e809a93ca895896f8654146a94352b76ffd523c3
shipit-source-id: e809a93ca895896f8654146a94352b76ffd523c3
  • Loading branch information
yungsters authored and Facebook Github Bot 6 committed Mar 25, 2016
1 parent f23a4b4 commit 97c977a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/container/RelayContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,16 @@ function createContainerComponent(
fragmentReference: RelayFragmentReference,
record: Object
): boolean {
if (!fragmentReference.isDeferred()) {
warning(
false,
'RelayContainer.hasFragmentData(): Method should only be called ' +
'with deferred fragments. However, `%s` is calling it with a ' +
'fragment that is not deferred.',
componentName
);
return true;
}
// convert builder -> fragment in order to get the fragment's name
const dataID = RelayRecord.getDataIDForObject(record);
invariant(
Expand Down

0 comments on commit 97c977a

Please sign in to comment.