Skip to content

Commit

Permalink
Merge pull request #266 from ianobermiller/environment-provider-type
Browse files Browse the repository at this point in the history
fix(types): RelayEnvironmentProvider should accept IEnvironment
  • Loading branch information
morrys authored Jan 15, 2024
2 parents df27b9f + c4ce295 commit 6b1115a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/RelayEnvironmentProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import * as React from 'react';
import { Environment } from 'relay-runtime';
import { IEnvironment } from 'relay-runtime';
import { ReactRelayContext } from './ReactRelayContext'; // eslint-disable-line @typescript-eslint/no-unused-vars

export const RelayEnvironmentProvider = function <TEnvironment extends Environment = Environment>(props: {
children: React.ReactNode;
environment: TEnvironment;
}): JSX.Element {
export function RelayEnvironmentProvider(props: { children: React.ReactNode; environment: IEnvironment }): JSX.Element {
const context = React.useMemo(() => ({ environment: props.environment }), [props.environment]);
return <ReactRelayContext.Provider value={context}>{props.children}</ReactRelayContext.Provider>;
};
}

0 comments on commit 6b1115a

Please sign in to comment.