File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1616 "keywords" : [
1717 " swc-plugin"
1818 ],
19- "main" : " next_superjson.wasm" ,
19+ "type" : " module" ,
20+ "main" : " ./dist/next_superjson.wasm" ,
2021 "exports" : {
2122 "." : " ./dist/next_superjson.wasm" ,
2223 "./tools" : " ./dist/tools.js" ,
Original file line number Diff line number Diff line change 33import { SuperJSONProps , withSuperJSONPage } from "./tools" ;
44import * as React from "react" ;
55
6- export default function SuperJSONComponent < P > ( {
6+ export default function SuperJSONComponent < P extends JSX . IntrinsicAttributes > ( {
77 component,
88 props,
99 children
Original file line number Diff line number Diff line change 11// original tool source from 'babel-plugin-superjson-next'
22
3- import * as hoistNonReactStatics from "hoist-non-react-statics" ;
3+ import hoistNonReactStatics from "hoist-non-react-statics" ;
44import type { GetServerSideProps } from "next" ;
5- import * as React from "react" ;
5+ import React from "react" ;
66import SuperJSON from "superjson" ;
77
88export type SuperJSONProps < P > = P & {
99 _superjson ?: ReturnType < typeof SuperJSON . serialize > [ "meta" ] ;
1010} ;
1111
12- export function withSuperJSONProps < P > (
12+ export function withSuperJSONProps < P extends JSX . IntrinsicAttributes > (
1313 gssp : GetServerSideProps < P > ,
1414 exclude : string [ ] = [ ]
1515) : GetServerSideProps < SuperJSONProps < P > > {
@@ -87,7 +87,7 @@ export function deserializeProps<P>(serializedProps: SuperJSONProps<P>): P {
8787 return SuperJSON . deserialize ( { json : props as any , meta : _superjson } ) ;
8888}
8989
90- export function withSuperJSONPage < P > (
90+ export function withSuperJSONPage < P extends JSX . IntrinsicAttributes > (
9191 Page : React . ComponentType < P >
9292) : React . ComponentType < SuperJSONProps < P > > {
9393 function WithSuperJSON ( serializedProps : SuperJSONProps < P > ) {
Original file line number Diff line number Diff line change 33 "compilerOptions" : {
44 "declaration" : true ,
55 "sourceMap" : true ,
6- "target" : " ES5 " ,
6+ "target" : " ESNext " ,
77 "rootDir" : " tools" ,
88 "outDir" : " dist" ,
99 "strict" : true ,
10- "moduleResolution" : " node" ,
11- "jsx" : " react" ,
10+ "module" : " ESNext" ,
11+ "moduleResolution" : " Bundler" ,
12+ "esModuleInterop" : true ,
13+ "jsx" : " react-jsx" ,
1214 "skipLibCheck" : true
1315 }
1416}
You can’t perform that action at this time.
0 commit comments