@isograph/react 0.0.0-main-905800be → 0.0.0-main-90264a00
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { ExtractReadFromStore, IsographEntrypoint, type FragmentReference } from './index';
|
3
|
-
export declare function EntrypointReader<TEntrypoint extends IsographEntrypoint<any, React.FC<
|
4
|
-
queryReference: FragmentReference<ExtractReadFromStore<TEntrypoint>, React.FC<
|
5
|
-
additionalProps
|
6
|
-
}):
|
3
|
+
export declare function EntrypointReader<TProps extends Record<any, any>, TEntrypoint extends IsographEntrypoint<any, React.FC<TProps>>>(props: {
|
4
|
+
queryReference: FragmentReference<ExtractReadFromStore<TEntrypoint>, React.FC<TProps>>;
|
5
|
+
additionalProps: TProps;
|
6
|
+
}): React.ReactNode;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@isograph/react",
|
3
|
-
"version": "0.0.0-main-
|
3
|
+
"version": "0.0.0-main-90264a00",
|
4
4
|
"description": "Use Isograph with React",
|
5
5
|
"homepage": "https://isograph.dev",
|
6
6
|
"main": "dist/index.js",
|
@@ -16,8 +16,8 @@
|
|
16
16
|
"prepack": "yarn run test && yarn run compile"
|
17
17
|
},
|
18
18
|
"dependencies": {
|
19
|
-
"@isograph/disposable-types": "0.0.0-main-
|
20
|
-
"@isograph/react-disposable-state": "0.0.0-main-
|
19
|
+
"@isograph/disposable-types": "0.0.0-main-90264a00",
|
20
|
+
"@isograph/react-disposable-state": "0.0.0-main-90264a00",
|
21
21
|
"react": "^18.2.0"
|
22
22
|
},
|
23
23
|
"devDependencies": {
|
package/src/EntrypointReader.tsx
CHANGED
@@ -7,14 +7,17 @@ import {
|
|
7
7
|
} from './index';
|
8
8
|
|
9
9
|
export function EntrypointReader<
|
10
|
-
|
10
|
+
TProps extends Record<any, any>,
|
11
|
+
TEntrypoint extends IsographEntrypoint<any, React.FC<TProps>>,
|
11
12
|
>(props: {
|
12
13
|
queryReference: FragmentReference<
|
13
14
|
ExtractReadFromStore<TEntrypoint>,
|
14
|
-
React.FC<
|
15
|
+
React.FC<TProps>
|
15
16
|
>;
|
16
|
-
additionalProps
|
17
|
-
|
17
|
+
// TODO make additionalProps optional if TProps extends Record<string, never>
|
18
|
+
// perhaps with a type overload
|
19
|
+
additionalProps: TProps;
|
20
|
+
}): React.ReactNode {
|
18
21
|
const Component = useResult(props.queryReference);
|
19
22
|
return <Component {...props.additionalProps} />;
|
20
23
|
}
|