-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): RelayEnvironmentProvider should accept IEnvironment
- Loading branch information
1 parent
6ba22ab
commit c4ce295
Showing
1 changed file
with
3 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
}; | ||
} |